![]() |
|
|
|
|
|||||||
| OS X (Apple) OS X is a line of Unix-based graphical operating systems developed, marketed, and sold by Apple. |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
vi
I have a file that at some point I removed all ^Ms and now I'm trying to put a newline return where the ^Ms used to be.
I probably removed the ^Ms a few years ago in Linux or SCO Xenix and now I'm using a MAC. With the file opened with vi I have tried the following: :%s/\.[A-Z]/\.^N[A-Z]/g I'm entering the ^N as ctrl-V ctrl-N and the /g is because as the file stands now I have 2 really long lines. The results I'm getting are just the literal ^N[A-Z]. |
| Forum Sponsor | ||
|
|
|
|||
|
I could be wrong, but on unix machines (like the Mac ;P ) the line endings (newline character) are generally referenced in regular expressions as "\n".
yes? Not being a vi guy, I do not know if regular expressions are handled the same way there... line feeds in csv |
|
|||
|
^M in document
the up carrot M is the Microsoft equiv to carriage return.
if they are appearing in the document or file its because they were either created or modified in MS Notepad or WordPad I haven't seen them actually impacting or impair the operation, so I ignore them. |
|
|||
|
In Linux, the simplest way to get rid of those funnies is using dos2unix command. No idea if something similar exists in OS X
|
|
|||
| Google UNIX.COM |
| Tags |
| linux |
| Thread Tools | |
| Display Modes | |
|
|