OK, so I've got some time on my hands due to a workplace injury, but due to a couple of broken bones and the good drugs, actually implementing something useful is proving challenging
I am playing with generating large numbers of Pick 6 lottery ticket combos. These are stored in tab-delimited text files, 1 ticket per line. For my purposes I'm looking at large numbers of combos - 10,000 or greater per file.
Somehow I need to check these ticket combo files for winning numbers (either prompted for, or read from another file) - specifically, 2/6 + bonus, 3/6, 4/6, 5/6, 5/6 + bonus, and 6/6. I need the total number of each per file. Flagging which line number of each would be useful as well.
Years ago I had knocked together a Perl script to do this, but that was several hard drives ago, and I have no idea if it still exists somewhere, and I haven't looked at the problem since.
So, I was thinking a shell script using grep and/or awk might work, but I have no idea how to get either utility to count individual numbers per line and add them up.
I have cygwin installed on Windows 7, so presumably BASH and the standard utilities should work.
I did search around, but found nothing relevant.
Thanks for all help (code samples appreciated).