Skyler99 has asked for the wisdom of the Perl Monks concerning the following question:
I'll appreciate any help. Please write to -->edge99off@hotmail.com
#! perl -w use strict; open(IN, "<c:\doclist.chr") or die "Couldn't open file, $!"; open(OUT, ">c:\doclist.txt") or die "Couldn't open file, $!"; while(<IN>) { chomp; # Remove the newline my ($var1, $var2, $var3, $var4, $var5, $var6, $var7) = split /,/; print OUT $var1,"|",$var2,"|",$var3,"|",$var4,"|",$var5,"|",$var6," +|",$var7,"\n"; } exit; close IN close OUT
update (broquaint): added formatting
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing a comma delimited file
by broquaint (Abbot) on Feb 13, 2003 at 14:07 UTC | |
by Skyler99 (Novice) on Feb 13, 2003 at 15:15 UTC | |
|
Re: Parsing a comma delimited file
by tachyon (Chancellor) on Feb 13, 2003 at 14:44 UTC | |
|
Re: Parsing a comma delimited file
by busunsl (Vicar) on Feb 13, 2003 at 14:06 UTC | |
|
Re: Parsing a comma delimited file
by bart (Canon) on Feb 13, 2003 at 14:36 UTC | |
|
Re: Parsing a comma delimited file
by tcf22 (Priest) on Feb 13, 2003 at 17:19 UTC |