Hi everybody,
I'd like to think I've been through the search tool not only on this site, but also on google too, but I haven't been able to find what I was looking for. If I might've missed something on this forum, please slap me in the face with a link that you consider useful for my query
I got a bunch of backup jobs that I need to order and grep only for those with errors:
Notice there are jobs which finish with status code 0 (on column 4 - meaning they're successful) and those with 196 (un-successful). I would like to print out only the lines containing jobs that DON'T finish successfully and order them by date. What I've managed to do was to use the sort -k 4,7 (column 7 is the starting date of the job) but I would also need to exclude from the printed lines those that don't matter to me (for example jobs that have failed 2 days ago... if we're on Sept 25, I'd like to have only lines containing failed jobs from Sept 25, NOT Sept 23rd). I think this is easy for most of the gurus here, but I'm just a storage guy, so do forgive my lack of knowledge on this
Last edited by Scott; 09-25-2011 at 08:32 AM..
Reason: Please use code tags to preserve formatting...
It would be simpler if the date was stored in YYYYMMDD format.
Some of your field numbers were wrong. Field "2", for example, is actually two fields in some cases. It's possible that the actual output is tab-delimited, but you just didn't paste it properly here?
This will add an extra field with that data format, then sorting is easier...
The last bit about getting the last two days I leave to you (or anyone else) .
Oh, yes, I should have been looking for "196", than assuming "not 0" meant error.
The odd American date format might save you this year, but not sure how well that sort will hold up when 2012 comes along.
Which would come first?
At least with most other date formats, you'd only have to wait until October for it to break - less time to forget what you did!
But the international format will never break
Did I labour that point too much?
If predictions are right, it's not only the American date format that will suffer, but all of us... and yeah, thanks for the effort Scott, but you went way beyond what I actually needed... It's like in string theory: it's absolutely wonderful mathematically, but no one can prove it right...
Hello All,
First post, don't know much about Linux/Unix, but I need some help. Normally, I do grep 'what I'm searching for' FILE > file.txt so I can pull data from one file, and put it into a new one. The issue I am having is with specific dates, since the date field is 4, and it appears... (3 Replies)
Hello All
I have an input file with data below. I would like to grep and display the data where 3rd column contains string or at least one character. Kindly please help me with this!
Input:
tjfa3|zznpou|224fdd.34.ff3.35 |Tiv|Otj|1
fgduul7|zznikj| ... (7 Replies)
I have a large * delimited text file and need to highlight specific columns on specific lines. The file looks similar to this:
ABC*01*00*01*00000 000000 *00000 000000 *35*0*0*0*0*20000*0*0*1*0000*00*4*0*3*0*0*1*0* *35*0000*001*4*1OT2*0148*0*0*0*0*0*0*6A7801B0**TEST1... (1 Reply)
I need to grep all records from a file that has 1072 in 3rd column. 1072 can be prefixed by "SBC.", "CLS." or "DPT.". My search is just based on string 1072 in 3rd column. Delimiter in the file is tab. For example:
Input FIle:
"InvType" "Organization" "SBC.10720101" "CP.BUP.NY"
"InvType"... (4 Replies)
Hello
I have a file with nearly 90000 lines in x,y,z format but have some lines that I do not need to show. Is there anyway to delete those 3 lines after every 288 lines.
Eg I keep the first 288 lines delete (289, 290 291); keep the next 288 lines after those and so on...
Thanks (6 Replies)
Hi have a large spreadsheet which has 4 columns
APM00111803814 server_2 96085 Corp IT Desktop and Apps
APM00111803814 server_2 96085 Corp IT Desktop and Apps
APM00111803814 server_2 96034 Storage Mgmt Team
APM00111803814 server_2 96152 GWP... (6 Replies)
Hi there,
I need a help with extracting data from tab delimited file which look like this
#CHROM POS ID REF ALT Human Cow Dog Mouse Lizard
chr2 3033 . G C 0/0 0/0 0/0 1/1 0/0
chr3 35040 . G T 0/0 0/0 ./. 1/1 0/1
chr4 60584 . T G 1/1 1/1 0/1 1/1 0/0
chr10 7147815 . G A 0/0 1/1 0/0 0/0... (9 Replies)
I'm a newbie in AIX, i want to make a script for grep any lines with date bellow 20
PRINT0089-88615 data1 3072 Mon Dec 19 17:53:49 WITA 2011
PRINT0089-88616 data1 4096 Mon Dec 19 17:53:49 WITA 2011
PRINT0089-88618 data1 5120 Mon Dec 19... (7 Replies)
Hello,
I am trying to write a shell script that will create a gnuplot file.
My main problem is that I have a data file with two columns:
1.05929120E+09 5.0000701214792
1.05930096E+09 5.00006386985764
1.05930584E+09 5.00019465404908
1.05931072E+09 5.00031960589719
... (2 Replies)