• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to parse CSV
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to parse CSV


  • Subject: Re: How to parse CSV
  • From: Benedikt Quirmbach <email@hidden>
  • Date: Fri, 25 Jan 2008 15:30:00 +0100

Thank you, Skeeve!

This is really fast enough... about 300 secs for the conversion including convertion to unicode...

But I have to do a lot of other operations with every item in the resuting list. And this takes to long!

It looks like I have to find another way to do the task. Maybe with Perl as you suggested or with a shell script...

Thanks to all who gave infos on this thread!

Benedikt

Am 24.01.2008 um 20:05 schrieb Skeeve:

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 (applescript- email@hidden)
Help/Unsubscribe/Update your Subscription:
40quirmbach.de
Archives: http://lists.apple.com/archives/applescript-users


This email sent to email@hidden

_______________________________________________ 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
References: 
 >Re: How to parse CSV (From: Benedikt Quirmbach <email@hidden>)
 >Re: How to parse CSV (From: Skeeve <email@hidden>)
 >Re: How to parse CSV (From: Skeeve <email@hidden>)

  • Prev by Date: Re: built&released application not functioning on other Macs..
  • Next by Date: Re: .chk files
  • Previous by thread: Re: How to parse CSV
  • Next by thread: Re: How to parse CSV
  • Index(es):
    • Date
    • Thread