• 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: CsvToListOfText
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CsvToListOfText


  • Subject: Re: CsvToListOfText
  • From: T&B <email@hidden>
  • Date: Fri, 15 Dec 2006 02:26:59 +1100

Hi all,

Following up:

The good news is that I think I have a solution, which actually avoids the previous bug fix method of using another repeat loop. It instead uses yet another text delimiter substitution

Back to more bad news. This new method also has a bug. If an item starts with a quote, the script doesn't parse it correctly. For example, this CSV text:


item1,item2,NULL,item4
item5,'''item6'', I said',NULL,'item''8'''

parses as:

{
{"item1", "item2", "NULL", "item4"},
{"item5", "item6', I said", "NULL", "item'8'"}
}

but should be:

{
{"item1", "item2", "NULL", "item4"},
{"item5", "'item6', I said", "NULL", "item'8'"}
}

Note the quote missing from the beginning of item 6.

Back to the drawing board :-(

Any suggestions welcome.

Has mentioned AS calling Python some time back. But as I replied then, I get an "End of File Error" when trying it.

Thanks,
Tom

_______________________________________________
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/mailman//archives/applescript-users

This email sent to email@hidden
References: 
 >Re: Importing/parsing CSV files (From: T&B <email@hidden>)
 >CsvToListOfText (From: T&B <email@hidden>)

  • Prev by Date: Re: awk question
  • Next by Date: Fwd: ctrl m question
  • Previous by thread: Re: CsvToListOfText
  • Next by thread: Re: Importing/parsing CSV files
  • Index(es):
    • Date
    • Thread