Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: Data validation and blank spaces in tab formatted csv file

by Tux (Abbot)
on Oct 24, 2013 at 14:22 UTC ( #1059478=note: print w/replies, xml ) Need Help??


in reply to Re^2: Data validation and blank spaces in tab formatted csv file
in thread Data validation and blank spaces in tab formatted csv file

For output, that would be similar to input

my $csv_o = Text::CSV_XS->new ({ binary => 1, sep_char => "\t", auto_d +iag => 1, eol => $/ }); open my $fhv, ">", $file_to_parse_valid or error ("Cannot open file +for write: $!"); open my $fhi, ">", $file_to_parse_invalid or error ("Cannot open file +for write: $!"); while () { if ("valid") { $csv_o->print ($fhv, [ $chu, $dev, $development_name, $bldg_no, $bldg_name, $unit +_id, $proj, $proj_name, $bdsz, $st_no, $street_name, $apt_no, $p_code, + $un_st, $mkt, $max_rent, $fut_movein, $p, $last_move_in, $last_move_out, + $pgm, $clt_no, $mgr_cd, $manager, $unit_status_dt, $cont_occ_dt, $pending +_move_out_dt, $unit_status_desc ]); } else { $csv_o->print ($fhi, [ $chu, $dev, $development_name, $bldg_no, $bldg_name, $unit +_id, $proj, $proj_name, $bdsz, $st_no, $street_name, $apt_no, $p_code, + $un_st, $mkt, $max_rent, $fut_movein, $p, $last_move_in, $last_move_out, + $pgm, $clt_no, $mgr_cd, $manager, $unit_status_dt, $cont_occ_dt, $pending +_move_out_dt, $unit_status_desc ]); }

Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1059478]
help
Chatterbox?
and !@monks...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2017-01-20 05:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (173 votes). Check out past polls.