10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need to grep multiple strings from a particular file.
I found the use of egrep "String1|String2|String3" file.txt | wc-l
Now what I'm really after is that I need to separate word count per each string found. I am trying to keep it to use the grep only 1 time.
Can you guys help ?
... (9 Replies)
Discussion started by: nms
9 Replies
2. Shell Programming and Scripting
Hi,
I need someone's help in writing correct perl code.
I implemented following code for "multiple search strings replaced with single string".
=========================================================
#!/usr/bin/perl
my $searchStr = 'register_inst\.write_t\(' |... (2 Replies)
Discussion started by: chettyravi
2 Replies
3. Shell Programming and Scripting
Hey guys. I know pratically 0 about Linux, so could anyone please give me instructions on how to accomplish this ?
The distro is RedHat 4.1.2 and i need to find and replace a multiple lines string in several php files across subdirectories.
So lets say im at root/dir1/dir2/ , when i execute... (12 Replies)
Discussion started by: spfc_dmt
12 Replies
4. Shell Programming and Scripting
Hello everyone,
ive been trying to replace a string "kw01" in an xml file with the contents of a txt file having multiple lines. im a unix newbie and all the sed combinations i tried resulted to being garbled. Below is the contents of the txt file:
RAISEDATTIME
--------------------... (13 Replies)
Discussion started by: 4dirk1
13 Replies
5. Shell Programming and Scripting
Can someone tell me how I can do this?
e.g:
Say file1.txt contains:
today is monday
the 22 of
NOVEMBER
2010
and file2.txt contains:
the
11th
month
of
How do i replace the word NOVEMBER with (5 Replies)
Discussion started by: tuathan
5 Replies
6. UNIX for Dummies Questions & Answers
Hi All,
Iam new to unix, I need to find string and replace it in the file name. Like
text_123_0.txt,text_123_1.txt,text_123_2.txt. I need to search 123 and replace it with 234 . Is there any unix command to replace them in single command since i have 5 directories. So i need to go each and every... (0 Replies)
Discussion started by: etldeveloper
0 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I have variable inside shell script - from_item.
from_item = 40.1'1/16
i have to first find out whether FROM_ITEM contains single quote(').
If yes, then that need to be replace with two quotes ('').
How to do it inside shell script? Please note that inside shell script........ (4 Replies)
Discussion started by: yogichavan
4 Replies
8. Shell Programming and Scripting
Hi,
I am creating a script to do a find and replace single/multiple lines in a file with any number of lines.
I have written a logic in a script that reads a reference file say "findrep" and populates two variables $FIND and $REPLACE
print $FIND gives
Hi How r $u
Rahul()
Note:... (0 Replies)
Discussion started by: r_sarnayak
0 Replies
9. Shell Programming and Scripting
Dear all
I need a script for multiple find and replace in a single file.
For example input file is -
qwe wer ert rty tyu
asd sdf dgf dfg fgh
qwe wer det rtyyui
jhkj ert asd asd dfgd
now
qwe should be replace with aaaaaa
asd should be replace with bbbbbbbb
rty should be replace... (6 Replies)
Discussion started by: wildhorse
6 Replies
10. UNIX for Dummies Questions & Answers
I used the following script
cd pathname
for y in `ls *`;
do sed "s/ABCD/DCBA/g" $y > temp; mv temp $y;
done
and it worked fine for finding and replacing strings with names etc. in all files of the given path.
I'm trying to replace a string which consists of path (location of file)
... (2 Replies)
Discussion started by: pharos467
2 Replies