use  $dbh->{'csv_tables'}->{'cimp_money'}    = { skip_rows => 2, ... and it should skip them .... but this isn't exactly documented official api so use at your own risk
#!/usr/bin/perl -- use strict; use warnings; use DBI; use DBD::CSV; #~ Souce Data my $data = q{X~Y~Z 1~2~3 col1~col2~col3~col4~col5 A~B~C~D~E }; use Path::Tiny qw/ path /; path( 'goner/Aviva_cimp_money_positive.txt' )->touchpath; path( 'goner/Aviva_cimp_money_positive.txt' )->spew_raw( $data ); #~ Output Data #~ X~Y~Z~~ #~ 1~2~3~~ #~ col1~col2~col3~col4~col5 #~ A~B~C~D~E my $dbh = DBI->connect("dbi:CSV:",undef,undef,{ #~ f_dir => $_ENV::TempFilesDIR +, f_dir => 'goner', csv_sep_char => "~", csv_quote_space => 0}) or die $DBI::errst +r; $dbh->{'csv_tables'}->{'cimp_money'} = { 'file' => 'Aviva_cimp_ +money_positive.txt', col_names => [qw(rcrd_typ +e seq_no emp_no forename surname initial ni_no ttl gender dob emp_cnt +rbtn emplyr_ctr tax_peri +od tax_yr exch_amt)], #~ csv +_skip_first_row => 'yes', #~ ski +p_rows => 4, ## haha skip them all skip_r +ows => 2, ## haha skip them all }; #~ dd( $dbh->{csv_tables} ); #~ $dbh->do('UPDATE cimp_money SET forename=?,surname=? WHERE emp_no=? +',undef,$wrk_forename,$wrk_surname,$wrk_emp_no) or die $DBI::errstr; #~ $dbh->do('UPDATE cimp_money SET forename=?,surname=? WHERE emp_no=? +',undef,'$wrk_forename','$wrk_surname','$wrk_emp_no') or die $DBI::er +rstr; #~ $dbh->do('UPDATE cimp_money SET forename=?,surname=? WHERE emp_no=? +',undef,'$wrk_forename','$wrk_surname',3) or die $DBI::errstr; $dbh->do('UPDATE cimp_money SET forename=?,surname=? WHERE emp_no=?',u +ndef,'$wrk_forename','$wrk_surname','col3') or die $DBI::errstr; print path( 'goner/Aviva_cimp_money_positive.txt' )->lines_raw( ); path( 'goner' )->remove_tree; #~ dd( { %$dbh } ); dd( $dbh->{csv_tables} ); #~ dd( $dbh->{csv_tables} ); __END__ $ perl fresher-dbi-dbd-csv-1128113.pl X~Y~Z 1~2~3 col1~col2~col3~$wrk_forename~$wrk_surname~~~~~~~~~~ A~B~C~D~E~~~~~~~~~~

In reply to Re: DBD::CSV Update by Anonymous Monk
in thread DBD::CSV Update by PERL_fresher

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.