in reply to Re^3: Read CSV with column mapping
in thread Read CSV with column mapping
I have tried adding if conditions as shown in following code but it is not skipping to add comment line and empty line. Am I doing something wrong?
config filewhile(my $colref = $csv->getline ($csv_fh)) { if (scalar(@$colref) =~ /^#/) { last; } if (scalar(@$colref) =~ /^s+$/) { last; } $output_hash{shift @{$colref}} = $colref; }
#ksjlasjda abc xyz,10 xyz pqr,2 pqr stq,0.1
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Read CSV with column mapping
by huck (Prior) on Dec 16, 2018 at 06:15 UTC | |
by AnomalousMonk (Archbishop) on Dec 16, 2018 at 06:31 UTC | |
by coretele (Novice) on Dec 16, 2018 at 17:59 UTC | |
by Tux (Canon) on Dec 17, 2018 at 07:59 UTC | |
by BillKSmith (Monsignor) on Jun 21, 2019 at 12:36 UTC | |
by poj (Abbot) on Dec 16, 2018 at 18:17 UTC | |
by coretele (Novice) on Dec 17, 2018 at 21:43 UTC | |
by poj (Abbot) on Dec 18, 2018 at 19:45 UTC | |
| |
by huck (Prior) on Dec 16, 2018 at 18:22 UTC |