How to Find /replace and print?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to Find /replace and print?
# 1  
Old 07-07-2005
How to Find /replace and print?

Hi,

I have one txt file, and I want replace 2 diffrent texts with somther text and the same time, I want to send that to print..

something like

sed -e 's/Times-Roman/Helvetica/'|sed -e 's/Times/Helvetica/' oldfile > newfile < lp

is this will workout? any idea?
# 2  
Old 07-08-2005
I can help with you the sed part. I am retaining your lp part of the code.

Code:
sed -e 's/Times-Roman/Helvetica/g' -e 's/Times/Helvetica/g' oldfile > newfile < lp

You can avoid two sed altogether.

Vino
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Awk, find and print

Ubuntu, Bash 4.3.48 Hi, I have this input file with many columns separated with ":" ARC=121:ERF=12244:IDE=2334:ADA=34 .... ERF=124:ARC=123:IDE=2344:ADA=54 .... ERF=16254:IDE=2434:ADA=78:ARC=134 .... and I want this: ARC=121:IDE=2334 ARC=123:IDE=2344 ARC=134:IDE=2434 I need to... (5 Replies)
Discussion started by: echo manolis
5 Replies

2. Shell Programming and Scripting

Need help for sed replace and print

Hi I am working with sed to get string replace and print all the lines. Cat f1 <text1> tag123 44412c232place1 text456-text= tag12 44412c232place4 jjaa TAG456 44412c232place1066dfdf erer .. i have used this command - sed -n '/tag/ s#place#SomePlace#gp' f1 It gives me... (2 Replies)
Discussion started by: krsnadasa
2 Replies

3. Shell Programming and Scripting

Scripting a global find and replace in an VME output print file

Hi Folks, Below is an extract from a VME Print file which gets handed over to a print house. The problem I have is not that tricky rther looking for a way to handle it in a simple and clean way. Is to first select all lines with "0058" which have four spaces so "0058 " as the selcetion... (3 Replies)
Discussion started by: Gary Hay
3 Replies

4. Shell Programming and Scripting

Hold, Replace and Print with sed

Hi, I'm a newbie with scripting so I'd appreciate any help. I have a file import.txt with below text AA_IDNo=IDNoHere AA_Name=NameHere AA_Address=AddressHere AA_Telephone=TelephoneHere AA_Sex=SexHere AA_Birthday=BirthdayHere What I need is that the Lines for Name, Address and... (3 Replies)
Discussion started by: heretolearn
3 Replies

5. Shell Programming and Scripting

Find and print Modification

Hi All I am stuck with a problem and i want your help. I have a file in which content of that file looks like-: <tr> <td><A HREF="http://333.33.333.33:3333/">Pan Eligibility</A></td> <td>NNNNNNNN_NS</td> <td>333.33.333.33</td> <td>3333</td> <td><p... (7 Replies)
Discussion started by: parthmittal2007
7 Replies

6. Shell Programming and Scripting

how to find out recurrence and print it.

Hi all, I have a file having data like this: rs4332761 15XB rs4332761 unk rs4571228 15XB rs457263 5XB rs4606515 10XA rs4606515 10XB rs4606515 15XB I want output like this: rs4332761 15XB,unk rs4571228 15XB rs457263 5XB rs4606515 10XA,10XB,15XB I... (2 Replies)
Discussion started by: pirates.genome
2 Replies

7. Shell Programming and Scripting

find and replace

Hi I am very new to shell scripting (and linux in general)... I am trying to build some script, that will read a person from a csv file, (each person will have an ID, eg id001abc, which will go up one by one a few hundred times) then when find and replace the matching data in an xml file. ... (4 Replies)
Discussion started by: sam.breslin
4 Replies

8. Shell Programming and Scripting

Find x and print its record

Hi all, I have a file containing two fields with 154 rows/records/lines (forgive me, my UNIX terminology is not quite up to par yet). I am trying to read from this list, find a value (lets say 0), then print the record/line/row that value falls on (In this case it would be record/line/row #27)?... (5 Replies)
Discussion started by: StudentServitor
5 Replies

9. UNIX for Advanced & Expert Users

Please help with find and replace:

Hi I am trying to find a product code hightlighted in red, and re-insert it at another place on the same file. I shall be grateful if anyone can help me with this. Stuck and have deadline!!:confused: Original Line: (I can get source data in one of these two formats) ISD=977155185403901+DIE... (2 Replies)
Discussion started by: gloovy_tb
2 Replies

10. Shell Programming and Scripting

find and replace

Hi, Iam new to shell script.How to write bourn shell script for find and replace. My requirement is: variable: name="abcd & co" i wanted to replace '&' with amp; plz suggest with out using sed. Thanks lot. (2 Replies)
Discussion started by: ram2s2001
2 Replies
Login or Register to Ask a Question