Writing Strings to a file and "special" strings.
Writing Strings to a file and "special" strings.
- Subject: Writing Strings to a file and "special" strings.
- From: Jerry LeVan <email@hidden>
- Date: Sun, 03 Nov 2002 12:50:29 -0500
Ok,
I have about twelve thousand NSMutableStrings stored in a mutable array
(each element of the array is a mutable array of NSMutable strings,
representing the fields of a "line" of the target file).
The user is specifying the field separator, line terminator and file name
via a dialog. ( So they might enter a \t for the field separator ).
I know from experimentation that the NSString @"\n" can be used to separate
a string into "lines" via
// Build an array of each line
lineList = [theFile componentsSeparatedByString:eol];
Where eol is defined by @"\n".
Do @"\t", @"\r" and @"\n" do the right thing when written to an "ascii"
file.
Is there an elegant way to write my giant array with say, my field elements
separated by @"\t" and each "line" terminated by @"\n" or @"\r" into an
ascii file?
Does anyone know why if a textField contains a\bc then NSLog will print the
backslash character four times ie
NSLog(@"result=%@", [textField stringValue]) will print a\\\\b ?
--Jerry
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.