Search Results

Search: Posts Made By: chingupt
3,394
Posted By chingupt
@brianjb Please provide that sample script...
@brianjb

Please provide that sample script you were talking about.

Regards
3,394
Posted By chingupt
Yes. Actually i am doing 2 changes in a...
Yes.

Actually i am doing 2 changes in a single file.

awk '$0 ~ /\"Search_string\"/ {print; getline; print replacement1; next} {print} ' replacement1="sometext" origFile > tmpfile1

awk...
3,394
Posted By chingupt
Awk: search and replace
I have a file which requires modification via a shell script.

Need to do the following: 0. take input from user for new text. 1. search for a keyword in the file. 2. going forward, search for...
2,165
Posted By chingupt
Hi Hanson, What if i have to replace the...
Hi Hanson,

What if i have to replace the line 2 or 3 lines after the match?

Regards
2,165
Posted By chingupt
Thanks Hanson. That solved it beautifully.
Thanks Hanson. That solved it beautifully.
2,165
Posted By chingupt
I did search but was not able to find a specific...
I did search but was not able to find a specific solution.
awk ' zap==1 {print "user input"; zap=0; next} /my pattern/ {zap=1; print $0; next} {print $0} ' infile > newfile

but issue comes when...
2,165
Posted By chingupt
Search text and replace line next to it
I have a file which requires modification via a shell script.

Need to do the following: 0. take input from user for new text. 1. search for a keyword in the file. 2. replace the line next to this...
Showing results 1 to 7 of 7

 
All times are GMT -4. The time now is 08:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy