Skip navigation.
 
mlDetecting new line character(s) in text file?
FROM : Jean-Nicolas Jolivet
DATE : Sat Nov 17 23:51:20 2007

My application deals with text files... each line has to be parsed so I
split it with

[str componentsSeparatedByString:@"\n"]

however..this only works if I have a text file that was saved on a
mac... Is there an easy way to determine which new line character is
used in a textfile (eighther linux, mac or win) and then use this for
parsing afterward?

Related mailsAuthorDate
mlDetecting new line character(s) in text file? Jean-Nicolas Joliv… Nov 17, 23:51
mlRe: Detecting new line character(s) in text file? John Labovitz Nov 18, 00:07
mlRe: Detecting new line character(s) in text file? Shawn Erickson Nov 18, 00:14
mlRe: Detecting new line character(s) in text file? Jean-Nicolas Joliv… Nov 18, 00:29
mlRe: Detecting new line character(s) in text file? Shawn Erickson Nov 18, 00:33
mlRe: Detecting new line character(s) in text file? Jean-Nicolas Joliv… Nov 18, 00:35
mlRe: Detecting new line character(s) in text file? mmalc crawford Nov 18, 00:44
mlRe: Detecting new line character(s) in text file? Ricky Sharp Nov 18, 00:44