hi guys, I have a script that opens a csv containing 50 columns, and splits it into two files, the first containing 30 columns, and the second containing 20 columns. I now need to re-open these files and delete rows where the column 0 is null and column 4 is null.
open my $in, '<:encoding(utf8)', $filepath_in or die; open my $courier_out_temp, '>:encoding(utf8)', $filepath_out_temp_cour +ier or die; while ( my $row = $csv->getline( $in ) ) { splice @$row, 0, 38; my $status = $csv->combine(@$row); if ($status) { print $courier_out_temp $csv->string(), "\n"; } }
I have this script, which works fine, and have tried various approaches to delete the records. Can anyone help?

In reply to Delete lines from CSV where column cell value is null by joshmcbride95

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.