Skipping lines on CSV import
Is there a way to skip say the first 5 lines of a file when importing?
(and filed names start on line 6)
It seems the only way to truly "skip" the lines would be to remove them from the source. That is likely not too hard to do. But, short of using a plug-in, methods would be slightly different for Mac or Windows. I'm mostly on a Mac.
Using the following AppleScript, via the FileMaker Perform AppleScript step (and changing file paths to match yours), this will read lines 6 to end of a text file, and write that to a 2nd file.
do shell script "awk 'NR>5' ~/Desktop/test.txt > ~/Desktop/test2.txt"
-- read lines 6 to end
The result will be UTF-8. If you need UTF-16, for special characters, it's a bit more involved (at least for me, as I don't know how force a " > " redirect to write UTF-16 encoding; I resort to vanilla AppleScript for that). Let me know if that is required.
Thanks guys. I wanted to avoid AS (not affraid of it, but complicates things if I want to do a distro)
Phil, can that be done when the field names are on say line 6? (What I'm trying to do is import a CSV from my bank, first couple lines are monthly totals of withdraws and deposits, so ony a couple of 'fields'. Will FM work ok with not filling all fields? )
Retrieving data ...