Re: How to parse CSV
Re: How to parse CSV
- Subject: Re: How to parse CSV
- From: Skeeve <email@hidden>
- Date: Thu, 24 Jan 2008 20:05:58 +0100
Now THIS seems fast!
on run
set started to current date
set {oAStid, AppleScript's text item delimiters} to {AppleScript's
text item delimiters, "|"}
set LoL to {}
repeat with rec in every paragraph of convert(choose file)
copy (a reference to text items of rec) to the end of LoL
end repeat
set AppleScript's text item delimiters to oAStid
set stopped to current date
display dialog "Seconds elapsed: " & (stopped - started)
return item 4 of (item 34900 of LoL)
end run
to convert(a_file)
return do shell script "perl -pe 'tr/\\012\\015//d; $_.=$/' " &
quoted form of POSIX path of a_file
end convert
272 seconds for 35000 lines with 10 elements each.
Question is: How fast is woring with the items...
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden