sort will, of course, resequence your file.
If this is not a problem then all well and good but if it is a problem then you have two possible solutions.
1) write a script to remove dupes using an associative array of some kind to see if the record to be output has been seen before.
2) use "seq" to create an index and "join" it to the end of each record in the first file. Then use "sort" to resequence AND remove dupes. Next sort again on the index we created (to sort back to the original sequence). Finally "cut" the index off again. Hey presto, your file is de-duped but not resequenced.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.