10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello Everyone,
i need to grep specific keyword in a file.
i want need solution to output.
example
file.txt
03-08-2019 21:02:20,938 ::: Recieve Data From Amazon :::
03-08-2019 21:02:20,938 IP : 192.168.1.1 | msg = Your confirmation code for 'Verify phone number' is xxxxx | sno =... (2 Replies)
Discussion started by: ooilinlove
2 Replies
2. Shell Programming and Scripting
Hi,
I have a situation where i need to read line by line from a text pad and with each line , i need to take inputs from command line and do some process.
Using below code i am not able to use 'read' keyword twice.
Can any one please help
cat > t.txt
a
d
c
> cat > t.ksh
while read... (4 Replies)
Discussion started by: Ravindra Swan
4 Replies
3. Shell Programming and Scripting
Hi,
here are few lines present in the logs. I want to grep on Error and print few lines before and after Error word is found
line1
Line2
Line3
Error
Line4
Line5
Line6
Line7
I want the output to be
Line2
Line3
Error
Line5 (1 Reply)
Discussion started by: arghadeep adity
1 Replies
4. Shell Programming and Scripting
Hi All.
how to grep with same keyword.
23-07-2012 15:15:30,117 ::: Recieve Message From Commadu :::
..
...
....
23-07-2012 16:15:28,481 ::: Recieve Message From Commadu :::
23-07-2012 16:15:28,481 IP : 127.0.0.1 | msg =... (1 Reply)
Discussion started by: ooilinlove
1 Replies
5. Shell Programming and Scripting
Hi,
here's the problem:
text="hello1 hello2
world
earth mars jupiter
planet"how do I print the text until it finds the keyword "mars" so that the desired output is
output="hello1 hello2
world
earth"
I have rtfm of sed and I think the problem is, that if I find the word "mars" it will... (7 Replies)
Discussion started by: icantfindauser
7 Replies
6. Shell Programming and Scripting
Hello All,
I have a bunch of files that have the following format, where the title is INPUT.txt and contains the following text:
INPUT-FILLER1 204
INPUT-FILLER2
FILLER6-INPUT 5
FILLER-INPUT
I want to go through the directory and remove the keyword INPUT. For example, my output would be... (5 Replies)
Discussion started by: jl487
5 Replies
7. Shell Programming and Scripting
Dear All,
I have a file containing info like
TID:0903 asdfasldjflsdjf
TID:0945 hjhjhkhkhkh
TID:2045 hjhjhkhkhkh
TID:1945 hjhjhkhkhkh
TID:2045 hjhjhkhkhkh
I need to show only lines containing
TID:0903 asdfasldjflsdjf
TID:0945 hjhjhkhkhkh
TID:2045 hjhjhkhkhkh
TID:2045 hjhjhkhkhkh
... (11 Replies)
Discussion started by: saifurshaon
11 Replies
8. Shell Programming and Scripting
Hi,
How to cut all lines in file before keyword?
from
1 2333214 word ...... some text
2 234343 234234 word ...... some text
3 234324 324 3234 word ...... some text
to
1 2333214
2 234343 234234
3 234324 324 3234 (4 Replies)
Discussion started by: Trump
4 Replies
9. UNIX for Dummies Questions & Answers
Hello,
How do I use grep to find a pattern in a list of file and then display 5 lines after the pattern is matched
Eg:
I want to match the string GetPresentCode in all files in a folder and then see 4 lines following this match. I am not sure if grep is what should be used to achieve. Thanks!... (3 Replies)
Discussion started by: cv_pan
3 Replies
10. AIX
Lets say I have a file containing string patterns to be looked for inside a file.
I would normaly do :
grep -if MyFilePattern FiletoSearchInto
if I use the -c it gives how many total lines it found out of my whole pattern file, but what if i want grep to report how many times it found each... (4 Replies)
Discussion started by: Browser_ice
4 Replies