Using Ruby as an AWK replacement
Someone at work asked if you could use Ruby like AWK. I did a little digging and found that you can.
'-n' makes the Ruby iterate over all lines successively assigning them to $_
'-a' makes Ruby split $_ into its parts assigning the result to $F which is an array of strings
'-e' means that what follows is code to be executed.
'-F' specifies the column separator
I performed a speed comparison on some different size files and operations. For files under 500kb lines Ruby has comparable performance to AWK. For anything larger then Ruby (1.8.6) is at best twice as slow. Though I wouldn't expect a general purpose language to outperform a specialist tool.