9 my $sourcetype = 'partial';
15 'headers!' => \$headers,
16 'source!' => \$sourcecolumn,
17 'source-type=s' => \$sourcetype,
18 'use-tab' => \$use_tab,
19 'use-comma' => \$use_comma,
25 if ($help || @ARGV == 0 || ($sourcetype ne 'partial' && $sourcetype ne 'full')) {
26 print "$0 <--headers|--noheaders> <--source|--nosource> <--source-type=full|--source-type=partial> <--use-tab|--use-comma> [file1] [file2] <fileN...>\n";
33 if ($sourcetype eq 'partial') {
34 my @f = split(/\//, $fn);
37 return "$s" . ($use_tab ? "\t" : ',');
44 if ($fn ne $ARGV[0]) {
45 my $check = <FILE>; # check and throw away headers for subsequent files
46 if ($check ne $first_headers) {
47 print STDERR "Mismatched headers between $ARGV[0] and $fn\n";
48 print STDERR "$first_headers\n$check\n";
52 print "x_source" . ($use_tab ? "\t" : ',') if $sourcecolumn; # potential column header
53 $first_headers = <FILE>;
57 while (my $line = <FILE>) {
58 print munged_source($fn) if $sourcecolumn;
65 foreach my $file (@files) {