• 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: "Mark J. Reed" <email@hidden>
  • Date: Tue, 22 Jan 2008 12:58:14 -0500

On Jan 22, 2008 12:01 PM, Ed Stockly <email@hidden> wrote:
> Directly parsing CSV in pure AppleScript could be done, but it would
> be a major headache.

Lessee how much code it took to do it in some other popular languages:

Read-only:
Java: CsvReader.java (from Java CSV library): 1679 lines
Lisp: csv-src.lisp  (from asdf): 202 lines

Read/Write:
Perl: CSV.pm + CSV_PP.pm (from CPAN): 790 lines
Python: csv.py (bundled): 415 lines
Ruby: csv.rb (bundled) 780 lines
Tcl: csv.tcl (from tcllib): 716 lines

So on average, that's about 750 lines of code.  I think doing it in a
robust way in AppleScript would take even more.

(Note that I subtracted the size of the embedded documentation in the
Java, Perl, Ruby, and Tcl; the others had the doc in separate files).


--
Mark J. Reed <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: Ed Stockly <email@hidden>)

  • Prev by Date: Re: OT: Curl
  • Next by Date: Re: How to parse CSV
  • Previous by thread: Re: How to parse CSV
  • Next by thread: Re: How to parse CSV
  • Index(es):
    • Date
    • Thread