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
Hello,
I am trying to grep search a pattern and a line before it.
cat input
>record1
hello1hello2hellonhello3
>record2
helloohello1hello2hello3
When I use, grep with -o option and either of -A/B/C options, I still can't see lines before or after the pattern. But the exact pattern is... (5 Replies)
Discussion started by: jacobs.smith
5 Replies
3. Shell Programming and Scripting
I need to fetch particular string from log file based on grep condition match.
Actual requirement is need to print the next word from the same line based on grep string condtion match.
File :Java.lanag.xyz......File copied completed : abc.txt
Ouput :abc.txt
I have used below... (5 Replies)
Discussion started by: siva83
5 Replies
4. Shell Programming and Scripting
consider below file contents
cat myOutputFIle.txt
8 CCM-HQE-ResourceHealthCheck:
Resource List :
No RED/UNKNOWN resource Health entries found
----------------------------------------------------------
9 CCM-TraderLogin-Status:
Number of logins: 0... (4 Replies)
Discussion started by: vivek d r
4 Replies
5. UNIX for Dummies Questions & Answers
Hello guys,
should be a very easy questn for you:
I need to delete strings in file1 based on the list of strings in file2.
like file2:
word1_word2_
word3_word5_
word3_word4_
word6_word7_
file1:
word1_word2_otherwords..,word3_word5_others... (7 Replies)
Discussion started by: roussine
7 Replies
6. Shell Programming and Scripting
i have a file like below
ABS 12234 A C 12G
CFY 23865 A C 34D
i want to grep "A C" then print
ABS 12G 12234
CFY 34D 23865
Thanks! (4 Replies)
Discussion started by: kingpeejay
4 Replies
7. Shell Programming and Scripting
hi,
if I grep a file, sometimes I want to see as an eg 2 lines above and below my grep results.
how can this be done
thanks (3 Replies)
Discussion started by: JamesByars
3 Replies
8. Shell Programming and Scripting
Hi ,
Please help me with the following problem:
I have an xml file with the following lines
<cisco:name>
<cisco:mdNm>Cisco Device 7500 A Series</cisco:mdNm>
<cisco:meNm>10.1.100.19</cisco:meNm>
<cisco:ehNm>/shelf=1</cisco:ehNm>
<cisco:subname>
<cisco:sptp>Cisco PortA... (8 Replies)
Discussion started by: bhagirathi
8 Replies
9. Shell Programming and Scripting
hi,
if i have a file and i want to search for the word error using grep, i usually want to see the surrounding lines too as they contain info about the error. what would be a nice way to achieve this?
thanks (6 Replies)
Discussion started by: JamesByars
6 Replies
10. UNIX for Dummies Questions & Answers
I would like to be able to grep (or some such thing) a search argument and then display the line plus the preceding 3 lines of the file and the following 3 lines of the file. Any ideas? Thanks in advance! :D (3 Replies)
Discussion started by: robster
3 Replies