Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unique count as a script?

 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While this is being done on Windows, I have some unix tools installed for most of the common commands.

My problem is:
I get a large set of data which gets parsed in various ways until it is a list of the names of soap messages, in alphabetical order eg

Is there a simple way to run a script to output
MessageOneRequest 3
MessageTwoRequest 5
or similar?

I know it would be easy in Java, but that may be out of the domain for this particular problem.

Dave
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's probably a better way, but I would just do



Call this with the filename as the only argument.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I'll give it a run later.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It wasn't until I looked at the manual for uniq and I saw the '-c' option.

Thanks for pointing me in that direction though!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic