merge_csv_files.pl - Command line client to Text::CSV::Merge
version 0.05
merge_csv_files.pl \ --base=merge_into.csv \ --merge=merge_from.csv \ --columns=EMAIL,FNAME,LNAME,LOCATION,JAN,FEB,MAR,APR,MAY,JUN \ --output=merge.csv \ --search=EMAIL \ --first-row-is-headers
You have two CSV files with mostly the same column names. But, the 'base' CSV files has gaps in its data, i.e. some cells are empty. Another CSV has data, but its too laborious to comb through it by hand. Use this CLI to fill in the gaps.
The CSV file into which you want to merge data.
The CSV file with which you want to fill in data gaps in base.
base
A quoted, anonymous list of column names. Non-ASCII column names are as yet untested.
The column name by which you want to match up rows in base and merge.
merge
Name of a file to which you want to direct the refined data. Default is merged.csv.
merged.csv
Specify 1 or 0 (or do not specify at all) to designate the first row of both CSV files as column headings.
Default is 1, or TRUE (Remember, Perl has no built-in Boolean).
Michael Gatto <mgatto@lisantra.com>
This software is copyright (c) 2013 by Michael Gatto.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Text::CSV::Merge, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::CSV::Merge
CPAN shell
perl -MCPAN -e shell install Text::CSV::Merge
For more information on module installation, please visit the detailed CPAN module installation guide.