Hi Everyone,
I'm very new at this. I know some Perl and barely any AppleScript. I would like
to improve an AppleScript that parses a large text file ( > 500k) and re-writes
it to another file so that it can be imported into a FileMaker database. I would
like to call a perl script to do the parsing part. Do you think perl will be
faster than applescript at parsing large files? The current applescript is not
using regular expressions. I understand that you can use them in applescript. I
don't know how much to ask Perl to do. Should I open/create/move files in the
AppleScript and let Perl do the text work? Or should I have Perl do everything?
What is your advice about this project?
Thank you,
Kathy Richmond
Here is my plan. Remember I don't know the correct commands to use. If you think
this is a good plan, I will start writing the actual code.
AppleScript
--------------------------
loop while files in toBeParsed folder
Call doScript to run the Perl script (pass fileName as arg)
Tell FileMaker to run its import records script. (I already
have this
working.)
end loop
Perl script
--------------------------
open file
create a new file named file+parsed in parsed folder
loop while lines in file
parse lines of file and create record (several lines make up
one record)
write one record at a time to file+parsed file
end loop
close file
move file to finishedParsed folder
close file+parsed file