i have a file that looks like
1254543534523233434
3453453454323233434
2342342343223233535
0909909092324243535
Is there a way / command in bash to remove duplicates on the file above, based on a specific substring, without changing their order in the output?
ie
(With substring -> ${line:11:8}
1254543534523233434
2342342343223233535
0909909092324243535
I know that :
sort -u : sorts them numerically, then removes duplicates
sort -kx,x -u : The same
cat filein | uniq : requires them to be sorted already or it will not work
I m trying to figure out if there's a native linux solution without having to resolve to perl code for it. Thank you in advance.