[PLUG] To the VI Question

Mark Morgan lemming at attbi.com
Tue Jul 16 00:29:08 UTC 2002


Matt Alexander wrote:
> OK, here's the contents of a text file after the od -c is run on it:
> 
> 0000000   b   o   b  \n   s   a   m  \n   j   o   e  \n   m   a   r   k
> 0000020  \n   s   a   l   l   y  \n   m   a   r   g   e  \n
> 0000035
> 
> So there are clearly newline characters.  But...  the :%s/\n/,/ doesn't
> work.  SoooooOOOOooOOoOOoooo...  Any guesses why?  This is a default
> RedHat 7.3 install.

I'm guessing the default vim that is installed doesn't deal with \n. 
Since you said that this file is generated by a command, how about if
we just make it look the way you want it?

Previous command | tr '\r\n' ',' > newfile

Though I think this will leave us with a trailing comma.

-Mark






More information about the PLUG mailing list