Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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

by Tux (Monsignor)
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


Comment on Re^3: Data validation and blank spaces in tab formatted csv file
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1059478]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (15)
As of 2014-08-22 16:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (160 votes), past polls