Paulgg
19th September 2002, 16:39
can we read an ascii file in baan script and store values from ascii file to table. if yes, what functions support this.
thanks
zacharyg
19th September 2002, 18:03
Hello,
Baan provides a wonderful tool to accomplish such requirements. Using Baan Exchange you don't have to do any coding. It can be run as a job for recurring imports and provides error logging.
If you must create a program then you can use seq.* functions to manipulate files.
E.g.
fd = seq.open( "/usr/baan/bse/import_file","r" )
while not seq.gets( buffer,nrofbytes,fd )
ttmmm999.???? = buffer(1;4)
ttmmm999.???? = lval(buffer(5;3))
db.insert( tttmm999 )
commit.transaction()
endwhile
evesely
19th September 2002, 20:45
If your data is delimited, you can use string.scan(...) to easily parse the data.