[Gambas-user] import data from text file and popolate a 2D array

Roberto Premoli roberto.premoli at tiscali.it
Tue Aug 31 13:47:58 CEST 2021


hello. i run gambas 3.12-2 (debian 10 stable)

I have a list of raw data into a text file. It is a database as follow:
[{field1,field2,...fieldN}},{field1,field2,...fieldN}},...{field1,field2,...fieldN}}]

each line starts with "{", end with "}}" and inside each line, the 
fields are separated by ",".

i wish to read the text file as input, get each "block" {...}}, and 
split it into fields to populate a database bidimentiona array (about 
6000 linees and 20 fields in each line).
I can elaborate all file database searching the "marker" ( the "{", the 
"," and the "}},") but I suppose it will be slow compared to a
dedicated command (if it exist).
I write here asking if there is some "magic trick" to elaborate strings 
that allow me to speed up all the process and avoid me to write
a dedicated funcion.

Thanks,
Roberto


More information about the User mailing list