Get the Plumbing Right With option parsing code in place, you
are now ready to add code for processing CSV files and for
making your script behave like a proper command line tool. It is
an old Unix tradition that commands can be piped together to
create more complex tools. Your script should obey that
convention; doing so will make it more flexible and allow other
users do things the authors of the software have never dreamed
of. Writing a Ruby script that fits into that scheme is actually
very simple. The simplest piece of code that copies everything
from STDOUT is just three lines long: while gets print end Add
it at the end of your script and see how it works. You do not
need to worry about the way data is sent to your script. Both
examples shown below give the same results, all without writing
additional code. $ cat file1 file2 | csvt -e 2,0 $ csvt -e 2,0
file1 file2 The simple loop shown in Section 6 is not very
useful, because it it does not do any processing of input. It
does illustrate the general csv