in reply to Re^2: insert null in missing places of csv
in thread insert null in missing places of csv
awesome
this meets my requirement, all other suggestions are even replacing 0 with NULL.
Could you please suggest me how can i call csv file directly inside the script instead of calling it on command prompt ?
This is what I am running using your input:
perl test.pl 1.csv#!/usr/bin/perl #use strict; use warnings; use Text::CSV_XS qw( csv); csv (in => csv ( in => *ARGV, blank_is_undef => 1, on_in => sub { $_ //= "NULL" for @{$_[1]}; }, ), );
all i need is to call 1.csv inside test.pl only
perl test.pl
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: insert null in missing places of csv
by Tux (Canon) on Feb 20, 2016 at 10:52 UTC | |
|
Re^4: insert null in missing places of csv
by hippo (Archbishop) on Feb 20, 2016 at 09:38 UTC | |
by ukhare (Novice) on Feb 20, 2016 at 10:12 UTC | |
by poj (Abbot) on Feb 20, 2016 at 10:48 UTC | |
|
Re^4: insert null in missing places of csv
by choroba (Cardinal) on Feb 20, 2016 at 18:08 UTC | |
|
Re^4: insert null in missing places of csv
by AnomalousMonk (Archbishop) on Feb 20, 2016 at 15:34 UTC |