in reply to Handling Mac, Unix, Win/DOS newlines at readtime...
I would split on /\r\n?/ instead. That avoids removing blank lines.
Update: In answer to graff's reply, /\r\n?|\n/ will work on all three platforms. I would probably just fix the original files with something based on the first regex I gave though. Better to standardize the files right off the bat. Customizing all sorts of code to deal with all three file types will get old real quick.
-sauoq "My two cents aren't worth a dime.";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Handling Mac, Unix, Win/DOS newlines at readtime...
by graff (Chancellor) on Sep 16, 2002 at 04:12 UTC | |
by jkahn (Friar) on Sep 16, 2002 at 04:17 UTC | |
by graff (Chancellor) on Sep 16, 2002 at 04:30 UTC | |
by IlyaM (Parson) on Sep 16, 2002 at 07:58 UTC | |
by bart (Canon) on Sep 17, 2002 at 04:05 UTC | |
by hardburn (Abbot) on Sep 16, 2002 at 13:54 UTC | |
by ikegami (Patriarch) on Oct 17, 2007 at 14:29 UTC | |
|
Re: Re: Handling Mac, Unix, Win/DOS newlines at readtime...
by bart (Canon) on Sep 16, 2002 at 23:44 UTC |