HI magice,
glad you made it work!
Please allow me to give to some important general hints:
1. Use QUOTES around object names! ALLWAYS!
fld "fField"
fld "tField"
etc...
2. When reading and writing to disk you might want to use the shorter URL syntax:
Instead of these 4 lines:
...
open file "Import/import.TXT" for read
read from file "Import/import.TXT" until EOF
put it into field "fText"
close file "Import/import.TXT"
...
You can have this ONE liner:
...
put URL("file:Import/import.TXT") into fld "fText"
...
FILE: for text files, BINFILE: for binary files
3. Tips for speed:
Do NOT access fields in a repeat loop!
This will slow down thing heavily!
Put everthing into a variable first, compute that variable and then write it back to a field.
Example:
...
repeat with i = the number of lines in field "fText" down to 1
if line i of field fText is empty then
delete line i of field fText
end if
end repeat
...
Better and MUCH faster:
...
put fld "fText" into tFText
repeat with i = the number of lines tFText down to 1
if line i of field fText is empty then
delete line i of field fText
end if
end repeat
## Now write content back to field:
put tFText into fld "fText"
But here you could even save some writing by using FILTER WITHOUT:
...
filter lines of tFText WITHOUT EMPTY
...
Best
Klaus