Search Results

Search: Posts Made By: farawaydsky
1,305
Posted By rangarasan
awk
Hi,

Try this one,

awk '{k=substr($0,1,8);if(a[k]){a[k]=k"00";next;}a[k]=$0;}END{for(i in a)print a[i];}' file

Cheers,
Ranga:-)
1,305
Posted By bartus11
Try:awk...
Try:awk '{a[substr($0,1,8)]++;b[substr($0,1,8)]=$0}END{for (i in a){if (a[i]>1) {print i"00"}else print b[i]}}' file
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 09:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy