thunderkid
Technical User
I am a novice user of awk. I am at the end of my wit trying to understand what I am doing wrong! I have the following script:
$4 == "rt45"
END { print $0 }
My input file:
seed1 0:01:41.0 2345 rt45
abc 0:01:42.0 2345 rt45
seed1 0:02:03.0 2345 rt45
abc 0:03:04.0 2345 rt45
seed2 0:03:05.0 erte wfe5
nuts 0:03:06.0 erte wfe5
nuts 0:04:07.4 erte wfe5
abc 0:05:08.5 erte wfe5
My output:
seed1 0:01:41.0 2345 rt45
abc 0:01:42.0 2345 rt45
seed1 0:02:03.0 2345 rt45
abc 0:03:04.0 2345 rt45
abc 0:05:08.5 erte wfe5
As I understand awk I should not be getting the last line of my input. I am using the following statement to get it to work:
awk -f myawk data
I have tried variation with printing selected fields, but this script prints out the complete line.
Terry
$4 == "rt45"
END { print $0 }
My input file:
seed1 0:01:41.0 2345 rt45
abc 0:01:42.0 2345 rt45
seed1 0:02:03.0 2345 rt45
abc 0:03:04.0 2345 rt45
seed2 0:03:05.0 erte wfe5
nuts 0:03:06.0 erte wfe5
nuts 0:04:07.4 erte wfe5
abc 0:05:08.5 erte wfe5
My output:
seed1 0:01:41.0 2345 rt45
abc 0:01:42.0 2345 rt45
seed1 0:02:03.0 2345 rt45
abc 0:03:04.0 2345 rt45
abc 0:05:08.5 erte wfe5
As I understand awk I should not be getting the last line of my input. I am using the following statement to get it to work:
awk -f myawk data
I have tried variation with printing selected fields, but this script prints out the complete line.
Terry