in reply to Re^3: to csv file
in thread to csv file

hey the thing is i need the output as csv , because it is an input to other sub routine

Replies are listed 'Best First'.
Re^5: to csv file
by poj (Abbot) on Jun 29, 2013 at 08:23 UTC
    I would change the other routine, but anyway, a simple solution would be double quote all the fields regardless.
    #!perl use strict; open OUT,">test.csv" or die "$!"; while (<DATA>){ chomp; s/;;/","/g; print OUT '"'.$_.'"'."\n"; } close OUT; __DATA__ abd;;sasa;;trre,dsa;;sdas;;dsss abd;;sasa;;trre,dsa;;sdas;;dsss
    poj