April 18, 2013

HOWTO: Get a random sampling of lines from a text file in bash

Let's say you needed to get 150 lines at random from a text file and you were running Linux.

The solution involves a command I wasn't aware of until today...shuf.

The command:

shuf file-to-sample.txt | head -n 150

shuf scrambles all the lines in the file; head pulls the set number of lines for you.

April 8, 2013

Resolution Update

Yes, I know there have been no updates for the last few weeks.  I've had some upheaval in my personal life that has prevented me from working on the #1 problem with my project...

It isn't fun to play.

It's functioning, but there's something missing.

Once I have time to work on it again (probably six to eight weeks), I'll start updating more, but in the meantime, I'm just trying to figure out where I twisted when I should have turned.