in reply to Re: insert null in missing places of csv
in thread insert null in missing places of csv

NOT WORKING :

<$ perl -lanF',' -e "print join',',map {$_ ? $_ : 'NULL'} @F " 1.txt Bareword found where operator expected at -e line 1, near "1.txt" (Missing operator before txt?) Bareword found where operator expected at -e line 1, near "1.txt" (Missing operator before txt?) syntax error at -e line 1, near "1.txt " Execution of -e aborted due to compilation errors.

Replies are listed 'Best First'.
Re^3: insert null in missing places of csv
by AnomalousMonk (Archbishop) on Feb 19, 2016 at 17:23 UTC

    My impression is that Discipulus's
        perl -lanF',' -e "print join',',map {$_ ? $_ : 'NULL'} @F " testcsvnull.txt
    is running under Windoze, and your
        <$ perl -lanF',' -e "print join',',map {$_ ? $_ : 'NULL'} @F " 1.txt
    is running under *nix. Fix the quoting as appropriate to your OS shell and give it another try.


    Give a man a fish:  <%-{-{-{-<

      is my impression too ;=)

      thanks for defending my -c honorability. Once i used to post oneliners in both quoting flavors but now i became too lazy. Maybe a comment like #warning winz doublequotes can be used.

      The real pity is that is impossible (from what i know) to convince that os to accept another quoting character.

      L*

      There are no rules, there are no thumbs..
      Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

      PERFECT