View Single Post
Old 11-19-2004, 05:07 AM   #11 (permalink)
idx
Senior Grasshopper
 
idx's Avatar
 
Join Date: Jun 2003
Location: FL
Posts: 317
idx is on a distinguished road
Yeah, \n is the unix line feed and \r is the carriage return. Although in editors you see ^M. You can remove the ^M's in VIM too.

Press : to get in command mode. then type:

g/\r//s//g

(I think that's right. it's close)



http://us2.php.net/language.types.string

Check out table 11-1.


Quote:
What do you mean 'Microsoft adds to the end of every line' ?
Yes, by default MS ends every line in a plain text file with a carriage return then a line feed. (\r\n) But unix/linux/etc only use the line feed so we end up seeing the CR as if it was actually part of the file.

Ever try to open a unix file in notepad? It gets all squished together with little blocks (the LF's) in between since it can't find the CR to separate lines.

I believe MAC's did something weird like end lines with only a CR.. Although maybe that was before the OSX days.

-r
idx is offline   Reply With Quote