in reply to Creating .csv file with comma

You don't show the code you're actually using to generate the CSV, and it's unclear to me how those quotes are being doubled. If you were to use Text::CSV, which I strongly recommend (also install Text::CSV_XS for speed), you actually don't need to do anything extra: the module will escape characters as necessary. If the escaping is different from what you need, look at the module's options. If you have trouble, post some runnable code with the expected output.

use Text::CSV; my $csv = Text::CSV->new({binary=>1, auto_diag=>2, eol=>$/}); $csv->print($fh, ['1234565', "Prototype", "Number in address is $number. Please, Please check your records." +]);

Replies are listed 'Best First'.
Re^2: Creating .csv file with comma
by Anonymous Monk on Apr 23, 2020 at 23:22 UTC
    Actually I am using Text::CSV to create the file, that's why the double quotes are been inserted in the file, is there a why to only have one set of quotes instead of two?
      Actually I am using Text::CSV to create the file, that's why the double quotes are been inserted in the file, is there a why to only have one set of quotes instead of two?

      Really? Because if you run the code I showed as-is, the string is surrounded by only one pair of double-quotes, as you want (1234565,Prototype,"Number in address is 100. Please, Please check your records."). And if you add double-quotes to the code I showed, it generates three double quotes in the output, not two, and that's the correct format if your double-quotes are escaped by doubling them. So again, show the code you're using.

      Actually I am using Text::CSV to create the file, that's why the double quotes are been inserted in the file, is there a why to only have one set of quotes instead of two?

      tickle the options :) escape_char