I don't know if you have a satisfactory solution yet, but this seems to work. Note that the substitution is done on any and all double-quoted strings in a record, not specific ones. If this is not acceptable, then you already seem able to extract specific fields and the substitution can be done on those fields individually. Note also that the  /r modifier of the  tr///r version of the substitution is available only for Perl versions from 5.14 onward; the other  tr/// expression works in any Perl version. (I've also used the  __DATA__ block from poj's code.)
File repl_commas_in_csv_1.pl:

use warnings; use strict; my $dq = qr{ " [^"]* (?: \\. [^"])* " }xms; my $rec = <DATA>; print qq{[[$rec]] \n\n]}; $rec =~ s{ ($dq) }{ (my $r = $1) =~ tr/,/ /; $r; }xmsge; # pre 5.14 # $rec =~ s{ ($dq) }{ $1 =~ tr/,/ /r; }xmsge; # 5.14+ print qq{[[$rec]] \n\n}; __DATA__ 1925,47365,2,650187016,1,1,"MADE, FOR, DRAWDOWNS, NEVER, P/U",16,IFC 8 +112NP,Standalone-6,,,44,10/22/2015,91607,,B24W02651,,"PA-3, PURE",4/2 +8/2015,1,0,,1,MAN,,CUST,,CUSTOM MATCH,0,TRUE,TRUE,O,C48A0D001EF449E3A +B97F0B98C811B1B,POS.MISTINT.V0000.UP.Q,PROD_SMISA_BK,414D512050524F44 +5F504F5331393235906F28561D2F0020,10/22/2015 9:29,10/22/2015 9:30

Update: I've just noticed that the AnonyMonk posted essentially the same idea here. I think the double-quote regex I'm using is a bit more robust than that one, but it still must be considered fragile compared to what may appear in a fully-fledged CSV record — a caveat that, I admit, I should have included in my original reply!


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


In reply to Re: Replace commas with spaces between quotes, parsing CSV by AnomalousMonk
in thread Replace commas with spaces between quotes, parsing CSV by BigRedEO

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.