File Archive

 
Output of file : EXAMPLE2.POM contained in archive : PAR233.ZIP

MINLEN "85"
;
IGNORE $FLINE[ 01 08] "Date: "
IGNORE $FLINE[ 49 67] "Order Expected"
IGNORE $FLINE[ 49 68] "Date Ship Date"
IGNORE $FLINE[ 10 32] "Item number/Description"
;
; Tidy up file line
;
CHANGE $FLINE """" "'"
;
; Determine where we are
;
IF $FLINE[8] = " " THEN ITEMCNTR = ITEMCNTR+ ELSE "0"
;
; Set variables
;
IF ITEMCNTR = "0" THEN REFNUM = $FLINE[ 1 8]
IF ITEMCNTR = "0" THEN CUSTCODE = $FLINE[ 10 15]
IF ITEMCNTR = "0" THEN CUSTDESC = $FLINE[ 17 47]
IF ITEMCNTR = "0" THEN ORDRDATE = $FLINE[ 49 57]
IF ITEMCNTR = "0" THEN MSTRCVDT = $FLINE[ 60 68]
IF ITEMCNTR = "1" THEN PRICE = $FLINE[105 114]
IF ITEMCNTR = "1" THEN QTY = $FLINE[ 76 86]
IF ITEMCNTR = "1" THEN PARTNUM = $FLINE[ 10 32]
IF ITEMCNTR = "2" THEN DESCRIP = $FLINE[ 10 43]
;
; Tidy up variables
;
TRIM REFNUM "B" " "
TRIM CUSTCODE "B" " "
TRIM CUSTDESC "B" " "
TRIM ORDRDATE "B" " "
TRIM MSTRCVDT "B" " "
TRIM PRICE "B" " "
TRIM PRICE "A" ","
TRIM QTY "B" " "
TRIM PARTNUM "B" " "
TRIM DESCRIP "B" " "
IF PRICE = "" THEN PRICE = "0.00"
IF QTY = "" THEN QTY = "0"
;
; Output
;
OUT ITEMCNTR = "2" |"{REFNUM}","{CUSTCODE}",{PRICE},{QTY},"{PARTNUM}",
OUTEND ITEMCNTR = "2" |"{DESCRIP}"
;
; Reset item counter
;
IF ITEMCNTR = "2" THEN ITEMCNTR = "0"