in reply to Re^2: splitting csv file and saving data
in thread splitting csv file and saving data

Humbug! :)

$ cat test.csv NPLUS,32,0, NW,41,0,1 NWER,51,"0,1,2",12 $ perl -MText::CSV_XS=csv -MData::Peek \ -wE'DDumper(csv(in=>"test.csv",on_in=>sub{$_[1][2]=csv(in=>\$_[1][2] +)->[0]}))' [ [ 'NPLUS', 32, [ 0 ], '' ], [ 'NW', 41, [ 0 ], 1 ], [ 'NWER', 51, [ 0, 1, 2 ], 12 ] ]

Enjoy, Have FUN! H.Merijn

Replies are listed 'Best First'.
Re^4: splitting csv file and saving data
by BrowserUk (Patriarch) on Nov 03, 2016 at 21:53 UTC

    ++ That is a perfect rebuttal to my incorrect assertion; and very impressive.

    But, I have questions:

    • How many people in the world, besides you, could have picked out the appropriate 2 or 3 lines from your amazingly detailed and comprehensive 1700 lines of module documentation to construct that solution?
    • And when if things go wrong -- say some of those weird MS Word double quotes characters had gotten mixed into the OPs data -- how many people would be qualified to try and diagnose the problem?

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
    In the absence of evidence, opinion is indistinguishable from prejudice.