I\'m trying to find a simple way of editing each line in a file, and I\'m having some trouble understanding how to use the File class to do so.
File
The file
Another way to modify the file inplace is to use the -i switch
-i
ruby -F"," -i.bak -ane 'puts $F[0]' file