Replace 'abc' with 'xyz'

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Replace 'abc' with 'xyz'
# 1  
Old 08-30-2009
Question Replace 'abc' with 'xyz'

Hi everyone

I am new to unix . i got struck up with small issue.

i have text file something like this

abc 'xyz' '5'
pqr 'lmn' '6'

i want to replace

abc 'xyz' '5' with abc 'tyr' '9'

but i know the key 'xyz'
based on the key 'xyz' i want to replace
please help me .
its urgent...
Note : key should be matched with single quote and replace with single quote.i want to replace the entire line from the key point with single quote.
# 2  
Old 08-30-2009
# 3  
Old 08-30-2009
is this homework?
# 4  
Old 09-01-2009
Thanks for your quick reply

It is not home work. i am working on project.

Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk xyz file in a for loop

hi good day I have a number of text files (xyz) that I want to format in to defined column widths (that is 7 digits (padding with zeros in cases where necessary) with 6 decimal places) using awk. . I can perform this on one text file at a time without any problems. However I want to write a... (2 Replies)
Discussion started by: johnstrong
2 Replies

2. Shell Programming and Scripting

get value between <abc and > by perl, awk

Hi Everyone, cat 1.txt a <abc b vfff c 000> d 4444 the output is: <abcvfff000> by using perl or awk, can get the value betwee "<abc" and ">", assume 1.txt has lots of those tags, so the output can filter out all those values. Please advice. Thanks (4 Replies)
Discussion started by: jimmy_y
4 Replies

3. Shell Programming and Scripting

How can i delete a keyword containing XYZ in unix

Hi all, I am trying to remove the words which has XYZ as a prt of that. My input file is something like this : PHNDAZLF-UPS-XYZ' aaaaaaa bbbbb ADFRTEJKS-XYZ cccccccc ddddddd rrrrrr SGETHEHDJ-ABC-RXY' hhhhh ttttt' kkkk FHJSKSJDKD-XXX-YYY Output expected is : aaaaaaa... (7 Replies)
Discussion started by: rdhanek
7 Replies

4. Shell Programming and Scripting

What is difference between ./ and .

Hi Friends I have one shell script If I run it ./ and . , then what is the difference.. Thanks Joy:confused: (1 Reply)
Discussion started by: itsjoy2u
1 Replies

5. Shell Programming and Scripting

how to make ABC into "ABC" ina file

suppose u have a file ABC CDF ADF FDG HAA AHH AHA so output shud be like "ABC" "CDF" "ADF" FDG " "HAA" "AHH" "AHA" (8 Replies)
Discussion started by: cdfd123
8 Replies

6. Forum Support Area for Unregistered Users & Account Problems

Same problem as xyz

Hi, Could you delete my account so that i can register again. My user id is ranj@tcs. The problem is I get a mail asking to click on the link to reset the password. Once that is done, the page says - 'The reset password has been mailed to you'. I done get that mail at all. So, please delete... (1 Reply)
Discussion started by: whyaskedhere
1 Replies

7. UNIX for Dummies Questions & Answers

How would you replace the n character in a file with some xyz?

How would you replace the n character in a file with some xyz? (2 Replies)
Discussion started by: JosephGerard
2 Replies
Login or Register to Ask a Question