10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all.
I have the following command that is successfully searching for any one of the strings on all lines of a file and replacing it with the instructed value.
cat inputFile | awk '{gsub(/aaa|bbb|ccc|ddd/,"1234")}1' > outputFile
This does in fact replace any occurrence of aaa, bbb,... (2 Replies)
Discussion started by: dazhoop
2 Replies
2. Shell Programming and Scripting
find . -type f -name "*.sql" -print|xargs perl -i -pe 's/pattern/replaced/g'
this is simple logic to find and replace in multiple files & folders
Hope this helps.
Thanks
Zaheer (0 Replies)
Discussion started by: Zaheer.mic
0 Replies
3. Shell Programming and Scripting
Hello,
I really would appreciate some help with a bash script for some string manipulation on an SQL dump:
I'd like to be able to rename "sites/WHATEVER/files" to "sites/SOMETHINGELSE/files" within the sql dump.
This is quite easy with sed:
sed -e... (1 Reply)
Discussion started by: otrotipo
1 Replies
4. Shell Programming and Scripting
Hello: I have another question. Please consider the following two sample, tab-delimited files:
File_1:
Abf1 YKL112w
Abf1 YAL054c
Abf1 YGL234w
Ace2 YKL150w
Ace2 YNL328c
Cup9 YDR441c
Cup9 YDR442w
Cup9 YEL040w
...
File 2:
...
ABF1 YKL112W
ACE2 YLR131C (9 Replies)
Discussion started by: gstuart
9 Replies
5. Shell Programming and Scripting
Hi All,
How do I search first string & second string and copy all content between them from one file to another file?
Please help me..
Thanks In Advance.
Regards,
Pankaj (12 Replies)
Discussion started by: pankajp
12 Replies
6. UNIX for Dummies Questions & Answers
Hi ,
I ahve a text file which has several instances of the text such as
run_time: 09:30
I need to add double quotes before and after the time value
i.e: run_time: "09:30"
Any suggestions on how to go about the same (4 Replies)
Discussion started by: jobbyjoseph
4 Replies
7. Shell Programming and Scripting
Hi All,
I have a file that I need to be able to find a pattern match on a line, search that line for a text pattern, and replace that text.
An example of 4 lines in my file is:
1. MatchText_randomNumberOfText moreData ReplaceMe moreData
2. MatchText_randomNumberOfText moreData moreData... (4 Replies)
Discussion started by: Crypto
4 Replies
8. UNIX for Dummies Questions & Answers
I want to carry out search & replace for the paths mentioned in the file with the help of vi.
'abc/' to be replaced by 'abc/data'
When I use command in vi as below -
%s/abc//abc/data/g
it gives me an error.
How we should deal with '/' part in string for vi search & replace?
... (6 Replies)
Discussion started by: videsh77
6 Replies
9. Shell Programming and Scripting
Hello all
i have big test file that has allot of structure text something like this :
<foo1 *.html>
<blah action>
somthing 1
somthing 2
</blah>
</foo1 >
now i will like to insert 2 more lines of text below the <blah action>
so it will be like :
<foo1... (1 Reply)
Discussion started by: umen
1 Replies
10. Shell Programming and Scripting
Is there any way we can achieve search & replace with awk?
I could achieve the same with sed in following way -
sed 's/A/B/g' file1 > file2
But the same regex if I try with using awk following way,
awk 's/A/B/g' file1 > file2
it gives me Syntax error. I strongly believe I am... (1 Reply)
Discussion started by: videsh77
1 Replies