in reply to Extract data from CSV field.

Hi JobC, welcome to the Monastery!

After writing my answer, it appears as though the #after lines are what you have already cleaned up (NOT your desired output). If that's correct, the below response is useless. Please clarify, and provide a few examples of what the final output should look like...

I may be under-thinking this, but could it be as simple as the following? Let us know if it does what you want. I simulate each one of your rows with an element in the @strings array:

use warnings; use strict; my @strings = ( ',"PAD, FOAM, 24 X 24 X 1/4 #16193 112 SHEETS PER ROLL, ORDER IN FULL ROLLS",', ',"PKG LIST,ASST ARM,RAD,300 #F37784",', ',"PAD, TOP CAP RE17-30048 #F30121 CORRUGATED ASSEMBLY, 22-7/8 X 21-1/8 X 4-3/4",' ); for (@strings){ s/\s+/ /g; print "$_\n\n"; }

Output:

,"PAD, FOAM, 24 X 24 X 1/4 #16193 112 SHEETS PER ROLL, ORDER IN FULL R +OLLS", ,"PKG LIST,ASST ARM,RAD,300 #F37784", ,"PAD, TOP CAP RE17-30048 #F30121 CORRUGATED ASSEMBLY, 22-7/8 X 21-1/8 + X 4-3/4",