CLS

OPEN "Ecovias.csv" FOR OUTPUT AS #1
WRITE #1, "POSTO", "CATEGORIA", "PBT_kgf", "QTD_EIXOS", "LIMITE_kgf"

OPEN "Ecovias_Posto28.csv" FOR INPUT AS #2
LINE INPUT #2, LINHA$
WHILE NOT EOF(2)
    INPUT #2, SEQPES, Dat$, CATEGORIA$, COMPRIMENTO, PBT, QTDEIXOS, LIMITE
    IF (PBT > 0 AND QTDEIXOS > 1) THEN WRITE #1, 28, CATEGORIA$, PBT, QTDEIXOS, LIMITE
WEND
CLOSE #2

OPEN "Ecovias_Posto30.csv" FOR INPUT AS #2
LINE INPUT #2, LINHA$
WHILE NOT EOF(2)
    INPUT #2, SEQPES, Dat$, CATEGORIA$, COMPRIMENTO, PBT, QTDEIXOS, LIMITE
    IF (PBT > 0 AND QTDEIXOS > 1) THEN WRITE #1, 30, CATEGORIA$, PBT, QTDEIXOS, LIMITE
WEND
CLOSE #2
CLOSE #1

SYSTEM
