On Mon, Jun 30, 2003 at 12:04:52PM -0400, Ronald J. Hall wrote: > If I had a text file that contained the winning Powerball numbers in our state > for the last 10 years, what would be the easiest way to search it for the > numbers that occurred the most often. Hopefully output to a text file, in > descending order by rank? > > Can I do that from bash? > > Thanks!
Yes, it depends on what the text file looks like; in general, you're going to probably use sort and then pipe it through uniq, such as cat file.txt|sort|uniq -c You might need to play some other tricks depending on the way the numbers appear in your text file. Do I get a cut when you win? :) Todd
Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com