Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need to replace "/" with "_" but there more than one "/

Status
Not open for further replies.

zqadora

Programmer
Nov 13, 2002
10
US
Hello,
I have a file that has the following pattern throught out the file

export -c test -n "test2201/10003.199990203.1444.MO" -f "test2201/10003.199990203.1444.MO"

The above is on one line. What I need is to change the "/" in the second occurrence, i.e. the one after f which is marked red to _ I was wondering if sed or awk can be used to do that.

Regards,

Ziad

 
Thanks for replying. I'm trying to do that with a file and not just a line. Will you please let me how to do that.

Regards,

Ziad
 
Hello,

I modified as follow and it worked.

cat filename | sed s/"\/"/"_"/2 > testfile

Again thanks for the tip it was very helpful.

Regards,

Ziad
 
Or use only a command: [tt]sed 'your script here' < input_filename > output_filename[/tt].


I hope it works...
Unix was made by and for smart people.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top