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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |