Avatar

building a cost control system with Basic-256 (New Features)

by DickStomp2 @, NL- SASSENHEIM, Saturday, February 21, 2015, 20:51 (858 days ago) @ DickStomp2

Reading and Converting Bank Transactions: LeesASNS.kbs

# omzetten van download ASN boekingen, convert bank transaction records
# datum DD-MM-JJJJ > JJJJ-MM-DD
# verwijderen kolommen, die niet ter zake zijn, remove fields not needed
# TYPE ASN-bank-data
# Datum AS STRING * 10 # 0 a DD-MM-YYYY
# RekVan AS STRING * 18 # 1 b IBAN # Account Debet
# RekNaar AS STRING * 18 # 2 c IBAN # Account Credit
# Naam AS STRING * 20 # 3 d Naam # Name
# Adres AS string # 4 e Adres
# Postcode as string * 7 # 5 f 9999 XX
# Plaats as string * 24 # 6 g Plaats
# Valuta as string * 3 # 7 h EUR
# SaldoVoor as string * 14 # 8 i -999999999.99
# ValutaMut as string * 3 # 9 j XXX
# Bedrag AS string * 14 # 10 k -999999999.99 # Amount
# DatumJourn as string * 10 # 11 l dd-mm-jjjj
# DatumValuta as string * 10 # 12 m dd-mm-jjjj
# InternTrans as string * 4 # 13 n 9999
# CodeTrans AS STRING * 3 # 14 o XXX # Transactioncode
# VolgnTrans as string * 8 # 15 p 99999999
# BetalingKmk as string * 16 # 16 q XXXXXXXXXXXXXXXX # Internal billing code
# Omschrijving AS STRING * 98 # 17 r # Description
# AfschriftNr as string * 3 # 18 s 999
# Kostenplaats AS STRING * 5 # nieuw # Budgetcode
#END TYPE
#DIM ASN-record AS ASN-bank-data # for Direct Access Files, not in use...

print currentdir()

invoer = 1 # input
Invoer$ ="ASNS.csv"
telinvoer = 0

uitvoer = 2 # output
Uitvoer$ ="ASNS.dta"
teluitvoer = 0

open (invoer,Invoer$)
if exists (Uitvoer$) then kill (Uitvoer$)
open (uitvoer, Uitvoer$)

while not eof(invoer)
Buffer$ = readline(invoer)
telinvoer = telinvoer + 1
L = length(Buffer$)
if L > 10 then
gosub VerwerkRegel
end if
end while

close (invoer)
close (uitvoer)

print "in: "+telinvoer+" uit: "+teluitvoer

print "klaar" # ready
print "vervolg met RekKostToev" # next program
end

VerwerkRegel: #
Buffers$ = mid(Buffer$,3,L-2) # strip quotes
veld$ = explode(Buffer$, '";"')
Record$ = right(veld$[0],4) # YYYY
Record$ = Record$ + mid(veld$[0],5,2) # MM
Record$ = Record$ + mid(veld$[0],2,2) # DD
Record$ = Record$ + veld$[1]+"," # IBANdebet
Record$ = Record$ + right(veld$[2],10)+"," # IBANcredit
Record$ = Record$ + veld$[3]+"," # Naam
Record$ = Record$ + veld$[10]+"," # Bedrag
Record$ = Record$ + veld$[14]+"," # TransCode
Record$ = Record$ + veld$[16]+"," # BillingCode
Record$ = Record$ + veld$[17] # Omschrijving
writeline(uitvoer,Record$)
teluitvoer = teluitvoer + 1
return


Complete thread:

 RSS Feed of thread

powered by my little forum