#!/usr/bin/perl -w use strict; use diagnostics; use Data::Table; use DBI; open( OUT, ">blah.csv" ) or die "cant open out $!"; open( OUT_no_fl, ">blah_no_first_line.csv" ) or die "cant open out $!"; my $dbh = DBI->connect( 'dbi:AnyData(RaiseError=>1):' or die $DBI::errstr ); $dbh->func( 'test_me', 'CSV', 'big_data_file.csv', { sep_char => ',', eol => "\015", col_names => 'ID,Seizoen,Brand,Model,Color,Size,Material,Stock' }, 'ad_catalog' ); my $select_from_data = Data::Table::fromSQL( $dbh, "SELECT ID, Size, Brand, Color FROM test_me WHERE Stock>'0'" ); $dbh->disconnect(); $select_from_data = $select_from_data->match_pattern( '$_->[1] =~ /^\d+$/ && $_->[1] >= 18 && $_->[1] <= 41'); print OUT $select_from_data->csv; open( FH, "blah.csv" ) or die "$!\n"; readline(FH); #<-- read the first line effectively skipping it while () { print OUT_no_fl $_; }