I'm not sure if this works for you, but the GNU textutils were made
for dealing with such data. A shell solution that works with any
number of CSV files is this:
Code:
paste -d, <(cut -d, -f8 file1.csv) <(cut -d, -f8 file2.csv) > output.csv
This pulls the eighth column from each file and pastes them into a new
file the way you would expect. You can specify as many files as you
need. One caveat is that this (and using split in Perl) will only work
on simple CSV data - meaning there are no embedded commas in the
fields themselves.
For properly parsing CSV data in Perl, there is a builtin module
Text::Parsewords that will do the right thing, even if the CSV
fields themselves contain commas or are quoted. Docs are here:
http://perldoc.perl.org/Text/ParseWords.html
The function to use is quoteword.
Continuing in Perl, you will need to build up a 2D array of columns
from each file first, then post-process the array, printing the
elements in the right order to a new CSV file. This might help for
ideas:
http://www.perlmonks.org/?node_id=46529
Doug