3

According to the documentation,

http://www.computerhope.com/unix/uuniq.htm

The command can be used to ignore the first n characters

Suppose I wish to have the following

03/08/2002,2,HUST,RICC,53.0,,2.3,J S BULLARD,,2,2,3/3,46.0,,,
03/08/2002,2,HUST,RICC,53.0,,WON,M J WALKER,,10,1,2/2,49.5,,,

Matched as identical based on the first 20 characters. Is there a way to do this?

Hoa
  • 19,858
  • 28
  • 78
  • 107
  • 2
    It seems you are not interested in characters >20. Maybe its enough to "simulate" `uniq -w` by `cut -c-20 YOURFILE | uniq`. – sgibb Mar 20 '12 at 20:40

1 Answers1

9

My uniq manual (coreutils 8.5) says:

-w, --check-chars=N
compare no more than N characters in lines

This however isn't standard (thus won't work on other Unixes).

cnicutar
  • 178,505
  • 25
  • 365
  • 392