thunderkid
Technical User
I am a novice at awk. I have searched database for script that I might modify, but have not had any success. I am trying to selectively picked records from data file. Here is a sample of input file:
123 <time1_data> aaaa
123 <time2_data> aaaa
234 <time3_data> aaaa
234 <time4_data> aaaa
234 <time5_data> aaaa
345 <time6_data> aaaa
345 <time7_data> aaaa
345 <time8_data> aaaa
345 <time9_data> aaaa
.
.
.
desired output:
The first extraction should pick the first record when col one fields are the same:
123 <time1_data> aaaa
234 <time3_data> aaaa
345 <time6_data> aaaa
In another extraction I need to pick the second record when col one fields are the same:
123 <time2_data> aaaa
234 <time4_data> aaaa
345 <time7_data> aaaa
These are two separate extractions. Nice to have one script which can be modified to do second extraction.
thanks
thunderkid
123 <time1_data> aaaa
123 <time2_data> aaaa
234 <time3_data> aaaa
234 <time4_data> aaaa
234 <time5_data> aaaa
345 <time6_data> aaaa
345 <time7_data> aaaa
345 <time8_data> aaaa
345 <time9_data> aaaa
.
.
.
desired output:
The first extraction should pick the first record when col one fields are the same:
123 <time1_data> aaaa
234 <time3_data> aaaa
345 <time6_data> aaaa
In another extraction I need to pick the second record when col one fields are the same:
123 <time2_data> aaaa
234 <time4_data> aaaa
345 <time7_data> aaaa
These are two separate extractions. Nice to have one script which can be modified to do second extraction.
thanks
thunderkid