Another command-line utility to deal with flat files: xsv (available on Homebrew).