Re: Importing flat files into FMP
Re: Importing flat files into FMP
- Subject: Re: Importing flat files into FMP
- From: Gary Lists <email@hidden>
- Date: Mon, 25 Nov 2002 21:35:53 -0500
On 11/25/02 9:16 AM, Eric Schult wrote:
>
I'm trying to import flat text files into FileMaker Pro, and so far it's
>
VERY slow going. I favor use of Tanaka's OSAX over Open for Access to read
>
the files.
Eric,
I don't know what quantitative values qualify as "slow", but I have my own
Text Filer for FM and I use a script, without any additions (OSAx), that
runs very speedily on my machine. (Again, no quantitative data to
share/compare.) You are welcome to the script.
It may be faster to consider breaking the process into two steps. 1) get the
flat files into FM and then 2) break out any of the header-style data that
is destined for other fields (i.e., Date, Publication, Category, etc.),
because access the fields is the slowest part of FM (any reference to "set
field" is a slow-down).
Here is the script I use, which is set to recursively grab sub-folder
contents as well (I have several script versions -- this one I call "Import
Fast", which I can send off list, that act on either: the Finder's selected
folder, a static-named folder or by asking which folder -- the one shown
here):
==========================================
on processFolder(theFiles)
script copyFiles
property fileList : {}
on open (theFile)
copy theFile as string to end of fileList
set thisItemsInfo to info for theFile
if alias of thisItemsInfo is not true then
try
tell application "Finder"
set theName to theFile as string
set theText to (read file theName)
end tell
tell application "FileMaker Pro 5.0v3"
set newRec to the ID of (create new record
[NO-BREAK-remove] at database 1)
go to record ID newRec
set cell "Text 1" of current record to theName
[NO-BREAK-remove]as string
set cell "Text 2" of current record to theText
[NO-BREAK-remove] as string
end tell
on error
end try
end if
return fileList
end open
end script
set warpDrive to walk folders theFiles with script copyFiles only using
[NO-BREAK-remove]files of type {"TEXT", "ttro"}
end processFolder
tell application "Finder"
set theFiles to (choose folder) as string
set selectionInfo to (info for theFiles)
end tell
set isFolder to get folder of selectionInfo
if isFolder = true then
processFolder(theFiles)
else
display dialog "Please select a folder!" buttons {"OK"} with icon stop
end if
==========================================
Might be useful, sorry if not...
Gary
--
Do not reply via email. Incoming replies are auto-deleted.
Please post directly to the list or newsgroup. Thank you!
Really need direct? Rot me at:
email@hidden
Lbhe fhowrpg zhfg ortva "abgwhax:" (ab dhbgrf)
Avpr gb zrrg lbh! Qba'g fcnz zr.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.