• 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
Parsing a simple text file, row per row
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Parsing a simple text file, row per row


  • Subject: Parsing a simple text file, row per row
  • From: "Frederick C. Lee" <email@hidden>
  • Date: Mon, 1 Aug 2005 10:34:38 -0700

Greetings:

I have a simple text file the with each line ending in a line feed (\n); or so I believe.


NSString *acDataString = [NSString stringWithContentsOfFile:rawAreaCodes encoding:NSASCIIStringEncoding error:myError];


NSArray *acRawRows = [acDataString componentsSeparatedByString:@"\n"]; <-- doesn't see "\n" (apparently).

What I get is the ENTIRE data file in ONE array element. The 'componentsSeparatedByString' apparently doesn't work with @"\n".

I don't want to put a printable character after each line.

How can I make the parser SEE '\n'?

Ric.


_______________________________________________ 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
  • Follow-Ups:
    • Re: Parsing a simple text file, row per row
      • From: Tony Cate <email@hidden>
  • Prev by Date: Re: Failed to copy Resource Fork??
  • Next by Date: Parsing a simple text file, row per row (*solved*)
  • Previous by thread: Re: Failed to copy Resource Fork??
  • Next by thread: Re: Parsing a simple text file, row per row
  • Index(es):
    • Date
    • Thread