On 05/04/2018 08:27 AM, yary wrote:
I understand your issues- try the regexp in my recent post, without
splitting & re-joining. Also, the margin removal aka "remove the final
slash an what's after it" can be simpler.
my $LabelStr='"00046436405","HALT 3/4" ORIG LNG #35-1333-RD/.55 +
SHP",""," 3/4"," don\'t give an""," 0.00"," 0.00","
0.00","",""," 0.00","35-1002-RD","WEAV","","","BRIDL","",""';
say $LabelStr, "\n";
$LabelStr ~~ s:g/(<!before ^> && <!after \, >) \" <!before \, | \s*$ >/
inch/;
$LabelStr ~~ s| \/ <-["/]>+ \" | \" |;
say $LabelStr;
The root problem is that CSV is an ad-hoc format and you've received a
particularly bad flavor...
-y
Splitting and rejoining fixed the issue. Keep in mind anything
you text may or may not work in this broken 2016 version of perl
1+ on the CSV