in reply to print a hash
Your original file will be moved to one with a .bak extension and the version with only unique lines will be left named as the original
Whoops, missed the fact that the OP grabs the last digits off the line and checks the uniqueness of them, not the entire line, this may be more to your liking
perl -pi.bak -e'$_=/(\d+)/?$1:"";$_="" if $seen{$_}++' <yourfile>Cheers,
R.
|
|---|