im using the following code to search a log for entries on two different lines:
data.txt
Now, when the above awk code is run on the data.txt file, it will pull out only the text im interested in, which is:
sometimes, there will be many instances where multiple "start error log" are present. but neither "I am logging the errors now" nor "App crashed" strings will be present. there will be other errors in their place, errors i dont care about. in these instances, the errors that I do care about "I am logging the errors now" and "App crashed" are usually towards the bottom under one of the other "start error log" strings.
so what ends up happening is that, the awk code tries to print everything it finds from the first "start error log" instance, to the last.
i want the awk code to skip printing an entire chunk of lines if the three patterns im looking for are not all there.
Hi, I need to print lines which are matching with start pattern "SELECT" and END PATTERN ";" and only select the last "select" statement including the ";" .
I have attached sample input file and the desired input should be as:
INPUT FORMAT:
SELECT
ABCD,
DEFGH,
DFGHJ,
JKLMN,
AXCVB,... (5 Replies)
Hi,
I have a text file the contents are like this
now i want to search patterns Z , Z etc and count the occurrence of such patterns, after Z value can be any random digits, please help me it is urgent...
output like this
Z .............>5
Z ............>8 (9 Replies)
Hi all,
I have a file having data:
@HWUSI-EAS1727:19:6:1:3674:984:0:1#GTTAATA
NTTGGGTTTTCT
@HWUSI-EAS1727:19:6:1:3674:984:0:1#GTTA...
NTTGGGTTTTCT
@HWUSI-EAS1727:19:6:1:3674:984:0:1#.....CT
NTTGGGTTTTCT
I want to print everything starting from # till line ends.
can you please help me how... (5 Replies)
Hi,
I am new to shell scripting and is working on a script to extract lines from a log file between two time stamps using awk command. After some research I used following command:
awk '/01 Oct 2011/{p=1} /10 Oct 2011/{p=0} p' test.log >> tmp.log
This works fine. But now i want to... (3 Replies)
Hi all ,
i need an help here.!!!! i have a file that contains /etc/passwd files from some servers.
i need a script which search for presence of a user in the servers.
like if i give 51144 to the script. the should be o/p
Please help on this..... (4 Replies)
I have two lists in a file that look like
a b
b a
e f
c d
f e
d c
I would like a final list
a b
c d
e f
I've tried multiple grep and awk but can't get it to work (8 Replies)
Hi Gurus,
I have a file say for ex. file1 which has 3500 lines in it which are different account numbers and another file (file2) which has 230000 lines in it. I want to read all the lines in file1 and delete all those lines from file2 which has that same pattern as in file1. I am not quite... (4 Replies)
hello,
i have an input file of about 50,00,000 lines. few of its lines are as follows:
<CR:0023498789,TPO-14987084;BO=IC&SUB=ALLP
<CF:0023498789,CB=YES;BIL&NC=NO
<CF:0023498789,CW=NO;NS=NO
<GC:0023498789,CG=YES;TPO&NC=YES
<CR:0024659841,TPO-14484621;BO=NO&BA=OC&SUB=ALLH... (1 Reply)