in reply to txt to csv

What does your input data look like? Are there space characters embedded in the fields? Null fields? Fields with characters >= 0x7f?

See the "quote_space", "quote_null" and "quote_binary" attributes that can be passed along to the constructor, documented in Text::CSV's POD.


Dave

Replies are listed 'Best First'.
Re^2: txt to csv
by serene_monk (Initiate) on Jun 24, 2013 at 05:23 UTC

    Hey thank you for helping out

    yes my file has spaces and special characters in it , if you could please point out the modification in code I will be grateful

      Which part are you having trouble with: Adding parameters to the constructor call, or understanding the portion of the POD that explains what parameters to add? Who wrote the code you're currently using?

      The line you need to modify is line 7. You'll be adding parameters to your call to the constructor (the new() method).


      Dave

        I have written the line 7 as

         my $csv = Text::CSV->new(({ binary => 1, eol => $/ }));

        still it puts " before and after every word