10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I have query to replace the first word in line using below code but its replace the middle word too
sed -i 's/load /# LOAD/' /tmp/check.sql
Query 1 :
UPDATE accheadcon_data_last_upload SET last_upload_date = '2017-07-23'
Replace to
UPDATE accheadcon_data_last_up# LOAD SET... (1 Reply)
Discussion started by: kaushik02018
1 Replies
2. UNIX for Beginners Questions & Answers
my inputfile:
This is a test and only a test for production - prod.
echo "This is a test and only a test for production - prod" | perl -pi -e 's/prod/test/g'
outputfile:
This is a test and only a test for testuction - test
I only want to replace prod, not production.
I also... (3 Replies)
Discussion started by: loktamann
3 Replies
3. Shell Programming and Scripting
All, I appreciate any help you can offer here as this is well beyond my grasp of awk/sed...
I have an input file similar to:
&LOG
&LOG Part: "@DB/TC10000021855/--F"
&LOG
&LOG
&LOG Part: "@DB/TC10000021852/--F"
&LOG Cloning_Action: RETAIN
&LOG Part: "@DB/TCCP000010713/--A"
&LOG
&LOG... (5 Replies)
Discussion started by: KarmaPoliceT2
5 Replies
4. UNIX for Advanced & Expert Users
Hi,
I want to search for a specific word in file and replace whole line with new text.
e.g.
1) I have file with below lines
APP=ABCD 12/12/2012
DB=DDB 01/01/2013
I need perl command which will check for APP=$VAL and replace whole line with APP=$NEWVAL $NEWDT
Simlarly need a... (2 Replies)
Discussion started by: mgpatil31
2 Replies
5. Shell Programming and Scripting
Hi,
I have been trying to replace the key word
"SQL> spool off "
with
"/
show errors"
with out double quotes in all the files in a directory.
above show erros should be displayed next line
Could you please help me how to do that.
I have tried something like this... (3 Replies)
Discussion started by: pointers
3 Replies
6. Shell Programming and Scripting
Hi folks,
have a look into the attachment, i am not familiar with unix, can you please help me in this regard.
thanks in advance, :)
regards,
Geeko (4 Replies)
Discussion started by: geeko
4 Replies
7. Shell Programming and Scripting
How do I replace only if the keyword is at the begining of a line?
Code:
--
a = “This is a print statement”
print a
--
What if I want to replace print by #print only in the second line i.e only if the line starts with that keyword.
Please help me out. I'm new to SED.
-----Post... (5 Replies)
Discussion started by: alexzubin
5 Replies
8. Shell Programming and Scripting
I have a file like this..
Maharastra Mumbai worli
Maharastra Mumbai navy
maharatra Pune
Maharastra Nagpur
Karnataka Bangalore
Karnataka Mysore
Karnataka Mangalore
Punjab Amritsar
punjab Jalandar
my expected outcome should be like this
Maharastra Mumbai worli
---------- ... (9 Replies)
Discussion started by: geeko
9 Replies
9. Shell Programming and Scripting
Hi i am trying to write a perl program where i have to open a
1)directory "unit"
2) rename the files in the dir say file1.txt;file2.txt...file5.txt
to file1_a.txt;file2_a.txt,....file5_a.txt ;file1_x.txt ;file2_x.txt
3) open these renamed files and replace the words
lets say file1_a.txt... (7 Replies)
Discussion started by: madhul2002
7 Replies
10. Shell Programming and Scripting
Could someone tell me how to replace a word at a particular line by a single SED or AWK command?
e.g. I have a file with the contents below:
$ cat file1
111 AAA
333 CCC
222 BBB
444 CCC
I want to replace the word "CCC" with a blank to get the desired output below:
111 AAA
333 CCC... (3 Replies)
Discussion started by: stevefox
3 Replies