Could you please tell me how I could extract all the records from a text file with say the 11 field as being 10000 e.g $11.
Sample::::
2/12/2003 14:15:13 4 2 1053 MSExchangeDS domain\administrator server /o=abc/ou=123/cn=Recipients/cn=test1234. 10000
The 10,000 may be a last field in each record or is $10
I want the file to loop to display all these to another out.txt file with header fields attached to new file:
e.g following as being first record for the header file under which the results will display
Type Date Time Source Category Event User Computer Description
I have tried various ways but I don't seem to be getting the desired result since I am no expert at this!
e.g
num = "1053"
num2= "10000"
{
if ($5==num && $10==num2)
{Print $0}
else
exit 1}
It only gives me two records which are both wrong, even though $10 is the location of the "10000" field!
Perhaps there is a better way with a while loop or something. I think my logic is wrong.
Thanks for your help.
Simon
Sample::::
2/12/2003 14:15:13 4 2 1053 MSExchangeDS domain\administrator server /o=abc/ou=123/cn=Recipients/cn=test1234. 10000
The 10,000 may be a last field in each record or is $10
I want the file to loop to display all these to another out.txt file with header fields attached to new file:
e.g following as being first record for the header file under which the results will display
Type Date Time Source Category Event User Computer Description
I have tried various ways but I don't seem to be getting the desired result since I am no expert at this!
e.g
num = "1053"
num2= "10000"
{
if ($5==num && $10==num2)
{Print $0}
else
exit 1}
It only gives me two records which are both wrong, even though $10 is the location of the "10000" field!
Perhaps there is a better way with a while loop or something. I think my logic is wrong.
Thanks for your help.
Simon