Re: How best to archive in CSV format
Re: How best to archive in CSV format
- Subject: Re: How best to archive in CSV format
- From: Bob Ippolito <email@hidden>
- Date: Mon, 16 May 2005 21:43:29 -0400
On May 16, 2005, at 9:37 PM, Brian Smith wrote:
On May 17, 2005, at 4:51 AM, Denis Stanton wrote:
I'm looking for advice on the best way to handle archiving my
documents in csv (comma separated variable) format.
These doubts make me think I'm going about this all wrong.
Should I be using the encode and decode system to convert to and
from csvs format?
Look at the references document to NSString and NSArray since they
have some methods for working with delimited data. You will find a
couple of methods for working with making and parsing strings from
arrays of strings and setting the delimiter to whatever you want,
(NSString)componentsSeparatedByString: and (NSArray)
componentsJoinedByString:. Also, you will find read and write
methods for creating files.
That sounds like a really bad idea because you need to deal with
quoting and such. You'll have to code this up by hand unless you can
find existing C or Objective-C code to do it. NSStringScanner might
help.
One alternative is to look at PyObjC, because Python ships with a csv
module.. though it's not optimal since current versions have a
limitation such that it only knows how to deal with bytestrings, not
unicode, so you have to encode everything into utf-8 before putting
it into the csv and decode it from utf-8 after getting it out.
In other words, it's time to decide whether you REALLY need CSV :)
-bob
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden