Don't say innocent if you mean punchline. On Tue, May 1, 2018, 10:46 PM ToddAndMargo <toddandma...@zoho.com> wrote:
> Hi All, > > You guys will noticed a bunch of things you have been helping me with > in the following. Thank you! > > :-) > > I have been working on cleaning up the file transfer of data from a > point of sale software (POS) program to a label printer. > > The customer puts his margin on the end of the description line, so > his labels show his margin, not that anyone would know what that > meant. He puts his margin and shipping after a slash. > > Anyway, the transfer file is a comma delimited text file. > "sss","dddd" etc. > > Well now, instead of writing out inches, he used a quote. > There goes the label program. So I changed " to inches. > > and the whacking to rid the margin was something to behold. > > <code MarginRemoverTest.pl> > #!/usr/bin/env perl6 > > my $LabelStr='"00046436405","HALT 3/4" ORIG LNG #35-1333-RD/.55 + > SHP",""," 3.95"," 0.00"," 0.00"," 0.00"," > 0.00","",""," 0.00","35-1002-RD","WEAV","","","BRIDL","",""'; > > say "$LabelStr\n"; > > $LabelStr ~~ s:global|"3/4\""|3/4 inch|; > $LabelStr ~~ s:global|(.*)\/(.*?)(\"\,.*)|$0$2|; > # say "0 = <$0>\n1 = <$1>\n2 = <$2>"; > say $LabelStr; > > > </code> > > $ RemoveMarginTest.pl6 > > "00046436405","HALT 3/4" ORIG LNG #35-1333-RD/.55 + SHP",""," > 3.95"," 0.00"," 0.00"," 0.00"," 0.00","",""," > 0.00","35-1002-RD","WEAV","","","BRIDL","","" > > "00046436405","HALT 3/4 inch ORIG LNG #35-1333-RD",""," 3.95"," > 0.00"," 0.00"," 0.00"," 0.00","",""," > 0.00","35-1002-RD","WEAV","","","BRIDL","","" > > > About killed me, but I got it. > > Part numbers and prices changed to protect the innocent. > > -T > > -- > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Computers are like air conditioners. > They malfunction when you open windows > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >