• Post Reply Bookmark Topic Watch Topic
  • New Topic

some simple unix question  RSS feed

 
Jackie Wang
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) I got a file:
ABC1234
ABC2345
CCD2330
EED2384
are there a command that can just grep the first 3 byte of data
i.e. the output is:
ABC
ABC
CCD
EED
?
Thanks!
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "cut" program does this. For your case,

would work fine.
 
Jackie Wang
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thx for the quick response Ernest.
appreciated that.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!