Added " " Quotes

Started by MW4, October 07, 2014, 06:52:22 PM

Previous topic - Next topic

MW4

Two sets of data below contained in a txt file(one three lines, one two lines):

(Note no quotes)
CUST PO
GOT1529 BASE VEHICLE PRICE > 18,515.00 16,587.00

CUST PO
GOT1505
BASE VEHICLE PRICE > 23,840.00 20,979.00


Code (winbatch) Select

if strsub(ThisLine, 1, 7) == "CUST PO"
if  StrSub(ItemExtract(InvoiceLine+1, pdfdata, @LF) ,strlen(ItemExtract(InvoiceLine+1, pdfdata, @LF)) -3,3) == ".00"
PoNum = strtrim(  StrSub(ItemExtract(InvoiceLine+1, pdfdata, @LF) , 1, StrIndex(ItemExtract(InvoiceLine+1, pdfdata, @LF)," ", 1, @FWDSCAN)))   
else
PoNum = StrSub(ItemExtract(InvoiceLine+1, pdfdata, @LF) , 1, strlen(ItemExtract(InvoiceLine+1, pdfdata, @LF)) )
endif
endif



results in this:

PoNum viewed in notepad
"GOT1505"
GOT1529

PoNum Viewed in Access (Quotes there but "hidden")
GOT1505
GOT1529

The mystery (and invisible in access) " " is not updating my access database because "GOT1505" doesn't exist ( GOT1505 does )
I'm assuming its an added CHR(22) but WHY is it getting added only on the one line?


I tried this and it doesn't clean the ""
rs.fields("PoNum").value =  StrTrim(StrClean (ponum,Num2Char(22), "", @TRUE, 1))

Any ideas?


JTaylor

Not sure with the information provided but one problem is that the Num2Char() function requires the Decimal number.  Assuming you are wanting to get rid of a double quote you need 34, not 22.

Jim

td

Or just use StrClean (ponum,'"', "", @TRUE, 1)
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

MW4

I already tried StrClean (ponum,'"', "", @TRUE, 1)

and neither

Num2Char(34)
0r
Num2Char(22)

works :(

MW4

the data is in a txt file just as shown.
The " " doesn't show up in the txt file, only after pulling the data using the code shown.

MW4

How about approaching from another angle...

Is there a way to "backspace" from the "B", to eliminate the @LF
GOT1505
BASE VEHICLE PRICE > 23,840.00 20,979.00

So it looks like this prior to processing to pull the POnum?
GOT1529 BASE VEHICLE PRICE > 18,515.00 16,587.00

The first data set is where the quotes are showing up.
The other it doesn't.



JTaylor

If you post the complete part script and a sample file that produces the problem it would be easier debugging as we could run your script and see the results you are seeing.

Jim