Perl script '?
, Perl Text:: CSV. CSV, sep_char, (, ), sep_char, pipe.
script
use strict;
use warnings;
use Text::CSV;
die "Usage: $0 in_file out_file\n" unless scalar @ARGV == 2;
my $in = Text::CSV->new({ binary => 1, blank_is_undef => 1 })
or die "Horribly";
my $out = Text::CSV->new({ binary => 1, sep_char => '|',
always_quote => 1, eol => "\n" })
or die "Horribly";
open my $fh_in, '<', $ARGV[0]
or die "Failed to open $ARGV[0] for reading ($!)";
open my $fh_out, '>', $ARGV[1]
or die "Failed to open $ARGV[1] for writing ($!)";
while (my $fields = $in->getline($fh_in))
{
$out->print($fh_out, $fields);
}
close $fh_in or die "Failed to close input ($!)";
close $fh_out or die "Failed to close output ($!)";
"$130.00","$2,200.00","$1,230.63"
"EUR1.300,00",,
"GBP1,300.00","$2,200.00",
"$130.00"|"$2,200.00"|"$1,230.63"
"EUR1.300,00"||
"GBP1,300.00"|"$2,200.00"|