Hi there,
I'm trying to write an AWK script where I have three variables that I pass to the script search a file for a line where the data in the columns matches what is passed in.
The data looks like this :-
aftn3200aftn3220CQA1-00000168.trigger
aftn3200aftn3220CQA1-00000169.trigger
aftn3200aftn3220CQA1-00000170.trigger
aftn3200aftn3220CQA1-00000176.trigger
aftn3200aftn3220CQA1-00000177.trigger
aftn3200aftn3220CQA1-00000178.trigger
aftn3200aftn3220CQA1-00000179.trigger
The fields that I'm trying to search on are
mnem 17-18
run_opt 19-20
batch_id 22-29
So if I passed in CQ A1 179 I would expect the resultant file to look like :-
aftn3200aftn3220CQA1-00000168.trigger
aftn3200aftn3220CQA1-00000169.trigger
aftn3200aftn3220CQA1-00000170.trigger
aftn3200aftn3220CQA1-00000176.trigger
aftn3200aftn3220CQA1-00000177.trigger
aftn3200aftn3220CQA1-00000178.trigger
Can anyone give me a few pointers as I'm struggling with the character column position bit of the script.
Thanks
Bob....
I'm trying to write an AWK script where I have three variables that I pass to the script search a file for a line where the data in the columns matches what is passed in.
The data looks like this :-
aftn3200aftn3220CQA1-00000168.trigger
aftn3200aftn3220CQA1-00000169.trigger
aftn3200aftn3220CQA1-00000170.trigger
aftn3200aftn3220CQA1-00000176.trigger
aftn3200aftn3220CQA1-00000177.trigger
aftn3200aftn3220CQA1-00000178.trigger
aftn3200aftn3220CQA1-00000179.trigger
The fields that I'm trying to search on are
mnem 17-18
run_opt 19-20
batch_id 22-29
So if I passed in CQ A1 179 I would expect the resultant file to look like :-
aftn3200aftn3220CQA1-00000168.trigger
aftn3200aftn3220CQA1-00000169.trigger
aftn3200aftn3220CQA1-00000170.trigger
aftn3200aftn3220CQA1-00000176.trigger
aftn3200aftn3220CQA1-00000177.trigger
aftn3200aftn3220CQA1-00000178.trigger
Can anyone give me a few pointers as I'm struggling with the character column position bit of the script.
Thanks
Bob....