/me thinks that's a typo in data (d,e,"f|g" should be d,e,"f,g"), as OP's spec has commas throughout...even inside the quotes.
Update: rephrased to clarify first line with attributions.
Update2: In fairness, JavaFan's s/("[^"]*")|,/$1||"|"/eg; appears to work with this data:
"x,y,z",red,blue 1,"2,3",4,foo,bar,"blivitz_kung" a,b,"c,d,e,",nodereaper "Super_Search","XP per node",data,"code tags,markup" monk,troll,saint,"holders of unholy powers","Orders of Monks:novice,in +itiate,etc"
(Update3: bah, humbug, copied wrong data. Fixed above.)
producing this output:
"x,y,z"|red|blue 1|"2,3"|4|foo|bar|"blivitz_kung" a|b|"c,d,e,"|nodereaper "Super_Search"|"XP per node"|data|"code tags,markup" monk|troll|saint|"holders of unholy powers"|"Orders of Monks:novice,in +itiate,etc"
Nonetheless, given the likelihood of (unknown, unspecified) edge-cases, a well-tested module remains the way to go, IMO.
In reply to Re^3: Replacing commas with pipes
by ww
in thread Replacing commas with pipes
by joec_
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |