in reply to Re: Converting CSV files to fixed width flat files
in thread Converting CSV files to fixed width flat files
Of course printf may truncate fields that are too#!/usr/bin/perl -w use strict; use Text::CSV; my $csv = Text::CSV->new; open (INPUT,"input.txt") or die "\nCan't open input.txt for reading : +$!\n"; open (OUTPUT,">output.txt") or die "\nCan't open output.txt for writin +g : $!\n"; select OUTPUT; while (<INPUT>) { $csv->parse($_); my @IF = $csv->fields(); foreach my $element (@IF) { #printf command goes here } print "\n"; }
Cheers - L~R
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Converting CSV files to fixed width flat files
by graff (Chancellor) on May 28, 2003 at 01:55 UTC | |
by PodMaster (Abbot) on May 28, 2003 at 02:03 UTC |