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 > UNIX for Dummies Questions & Answers
.
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 04-25-2007
IHulky IHulky is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 4
Sed command with characters

Hi everyone, I hope that someone can help me out:

In the following line:

PRIHDR;2809999444;2007 6.1;20070423;9;;4021473000003;;4021473000003;8714231530688;EUR;;

The output should be:

PRIHDR;2809999444;2007 6.1;20070423;4;;4021473000003;;4021473000003;8714231530688;EUR;;

I've tried some variations on the following command:

sed 's/;9;;/;4;;' <oldfile>newfile

When I run this command it tells met what to do with the ";" how can I solve this issue?

Thanks in advance,

IHulky

p.s. the other lines in the document (line 2 and further) have to be copied as well to the new file.

Last edited by IHulky; 04-25-2007 at 07:57 PM..