The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Operating Systems > OS X (Apple)
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #6 (permalink)  
Old 03-27-2009
Gale Gorman Gale Gorman is offline
Registered User
  
 

Join Date: Oct 2007
Location: Houston
Posts: 11
I thought my original message was clear.

This is one long file in a single line. Wherever XXX appears I need a carriage return or newline so the file can be read and edited with vi.

So I'm not just trying to get rid of XXX, I'm trying to REPLACE them with a carriage return.

I originally screwed up this file after it had been saved in MS Word and of course there was a ^M everywhere.

I used the substitute command in vi to get rid of those ^Ms but still didn't achieve the result I wanted. Then I substituted XXX for ^M with:

:%s/^M/XXX/g