Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • How tac {input} | uniq -w 9 work? Commented Jun 19, 2014 at 17:32
  • @Gnouc, -w N will only consider the first N chars. For my local file I had a 9 char ID in the first column, so uniq -w 9. Commented Jun 19, 2014 at 17:34
  • I tested with your input and the result is not correct. Commented Jun 19, 2014 at 17:35
  • @Gnouc, Yes for the small input, uniq -w 5should work. I think your and Mikels answers are better, since they do not make an assumption about the number of chars in the first column. However, if the input follows such a constraint, then uniq -w is the fastest. Commented Jun 19, 2014 at 17:36