Hi,
I have a requirement where I have to remove duplicates from a file based on the first 8 chars (It is fixed width file of 10 chars length) and whenever a duplicate row is found, its original row's last 2 chars should be updated to all 0's.
I thought of using
sort -u -k 1.1,1.8 inputfile
but that will give me the result after remove duplicates and with the original last digits as is for the duplicate records
here is the sample input and output
Any help in achieving the above result using either awk/sed will be greatly appreciated.
Thanks,
Faraway