in reply to Convert CSV file to TAB delimited
Something like this:
use strict; use warnings; use Text::CSV; my $csv = Text::CSV->new( { binary => 1 } ); my $tsv = Text::CSV->new( { binary => 1, sep_char => "\t" } ); open my $infh, '<:utf8', 'input.csv' or die $!; open my $outfh, '>:utf8', 'output.tsv' or die $!; while ( my $row = $csv->getline($infh) ) { $tsv->print( $outfh, $row ); print $outfh "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Convert CSV file to TAB delimited
by Tux (Canon) on Sep 23, 2010 at 01:19 UTC |