【发布时间】:2013-06-02 00:22:21
【问题描述】:
我想在使用 Perl 库 Text::CSV_XS 时忽略 CSV 文件中的标题。
有没有比以下更好或更合适的方法:
use Text::CSV_XS;
open(my $fh, "<", "file.csv") or die "file.csv: $!";
my $csv = Text::CSV_XS->new();
#ignore header
my $row = $csv->getline($fh);
while ($row = $csv->getline($fh)) {
#do stuff with the rows...
}
【问题讨论】: