in reply to Re: Huge files manipulation
in thread Huge files manipulation
One reason for not using sort -u or uniq commands is if you wish to retain the original ordering (minus the discards).
As said earlier in the thread, if you want to keep ordering, just add the line number, sort, uniquify, sort on the line number and cut. Or, as a one liner:
This is a standard trick.nl -s '|' file_with_dups | sort -k 2,8 -t '|' -u | sort -nb | cut -d ' +|' -f 2- > file_without_dups
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Huge files manipulation
by BrowserUk (Patriarch) on Nov 10, 2008 at 16:05 UTC | |
by JavaFan (Canon) on Nov 10, 2008 at 16:48 UTC | |
by BrowserUk (Patriarch) on Nov 10, 2008 at 17:36 UTC |