Help for this page

Select Code to Download


  1. or download this
    perl -lne '$n=tr/,//;$h{$n}++;END{print "$h{$_} rows have $_ commas" f
    +or (keys %h)}' some_file.csv
    
  2. or download this
        split(",")
    
  3. or download this
        split( /,/, $_, -1 );
    
  4. or download this
       @array = split( /,/, "field1,field2,,field4,field5,,," );
    
  5. or download this
       ( 'field1', 'field2', undef, 'field4', 'field5' );