10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i had requirement like i need to get "error" line of above 3 and below 3 from a file .I tried with the below script.But it's not working.
y='grep -n -i error /home/file.txt|cut -c1'
echo $y
head -$y /home/file.txt| tail -3 >tmp.txt
tail -$y /home/file.txt head -3 >>tmp.txt (4 Replies)
Discussion started by: bhas85
4 Replies
2. Shell Programming and Scripting
Hi Folks,
I have a log file at the following location..
/opt/ert/abc.log
Now abc.log contain the following enteries in this format below..
23-Jul-2014 10:09.32.204 ERROR abc.log cdfrer tyre fgty >>>>> cqno : 78539132 abc Id : 0 Sabc : 20140724
Now in log file (abc.log) I want to... (2 Replies)
Discussion started by: tuntun343466
2 Replies
3. Shell Programming and Scripting
HI
I have a file with output as
System: cu=4 ent=0.1 mode=on
cu min u s w i
0 500 0.1 0.3 0.5 0.1
1 200 0.5 0.2 0.3 0.0
I need to grep the values of following column fields u, s, w and i from each row sum them up and store in a variable..:(
Please help.. (3 Replies)
Discussion started by: Priya Amaresh
3 Replies
4. UNIX for Advanced & Expert Users
Hi,
I have a requirement like, I have a list of pattens in a file say pattern.txt,
PHC111
PHC113
and in another file called master.lst i have entries like,
PHC111
a
b
PHC112
a
PHC113
b
c
PHC114
d
e (5 Replies)
Discussion started by: rbalaj16
5 Replies
5. Shell Programming and Scripting
Hi All,
I'm trying to grep for 3 patterns in a string of gibberish. It so happens that each line is appended by a date/time stamp and i was able to figure out how to extract only the datetime.
here is the string..
i have to display
tinker tailor soldier spy
Please can some help... (2 Replies)
Discussion started by: Irishboy24
2 Replies
6. AIX
I have 2 files: fileA and fileB.
content of fileA
---------------
admin.teacher is in new york;
admin.mason is in new york;
admin.driver is in new york city;
user.trucker is in hartford;
admin.developer is in new york state;
content of fileB
----------------
admin.teacher is in... (8 Replies)
Discussion started by: lowprofile
8 Replies
7. UNIX for Dummies Questions & Answers
Hiiii
I have a file which contains huge data as
a.dat:
PDE 1990 1 9 18 51 28.90 24.7500 95.2800 118.0 6.1 0.0 BURMA
event name: 010990D
time shift: 7.3000
half duration: 5.0000
latitude: 24.4200
longitude: 94.9500
depth: 129.6000
Mrr: ... (7 Replies)
Discussion started by: reva
7 Replies
8. Shell Programming and Scripting
Guys ..
Need to pull this highlighted strings irrespective of line numbers & should be echoed . But these strings are from Outfile from different dir. In which way this can be grepped ?? Need an idea
http-timeout 120 seconds
persistent-timeout 180 seconds
host-rewriting on
... (7 Replies)
Discussion started by: raghunsi
7 Replies
9. Shell Programming and Scripting
Hi,
I need a regular expression grepping all lines starting with '*' followed by a VARIOUS number of blanks and then followed by the string 'Runjob=1'.
I tried that code, but it doesn't work:
grep -i '*'+'Runjob=1' INPUT_FILE >>OUTPUT_FILE
Can someone help me?
Thanks (8 Replies)
Discussion started by: ABE2202
8 Replies
10. UNIX for Advanced & Expert Users
Hi, I wonder if anyone can help me. I have a file with about 200 lines in it. I am wanting to set up a Count so that it picks out each line at turn and edits the line. However i am having trouble pulling out the specific line. I have a feeling it will be done somehow by a grep -n but what ever i... (2 Replies)
Discussion started by: mariner
2 Replies