#!/usr/bin/perl use strict; use warnings; use Text::CSV; my $file = '112008.csv'; my $output='112008.txt'; my $csv = Text::CSV->new(); open (CSV, "<", $file) or die $!; open(OUTFILE,">$output") || die "Can't open file $output"; while () { if ($csv->parse($_)) { my @columns = $csv->fields(); printf OUTFILE "@columns\n"; } else { my $err = $csv->error_input; print "Failed to parse line: $err"; } } close CSV;