The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 12-23-2005
stevefox stevefox is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 115
Question How to delete carriage return in SED

Could someone tell me how to do the below without opening the file? (eg in sed or awk)

I have a file with the contenst below:

$ more file1.txt
10
AAA;
200
BBB;
3
CCC;


I want to delete the carriage return of one line above the line which has ";" at the end to get the below:

10 AAA;
200 BBB;
3 CCC;

Any help will be appreciated.