Hi,
I have two different tables and I want to save both on an unique file via writetable using the default option. They are written correctly while the reading is impossible receiving an error message. Saving the two tables, each one in a different file, they are correctly read.
There is a way to have an unique file?
readtable & json file
Re: readtable & json file
cant use Seek() as said in manual to move pointer to end of first table and read next?
Christos
Re: readtable & json file
Yeah, it seems that when using the "default" adapter, which writes it as JSON, it gets confused when you try to read it. The combined text file isn't in valid JSON format and serializer doesn't know how to handle it. The old "inbuilt" adapter handles this differently by reading tables as binary and continuing where the previous ended.ilbarbax wrote: ↑Tue Feb 17, 2026 8:10 pm Hi,
I have two different tables and I want to save both on an unique file via writetable using the default option. They are written correctly while the reading is impossible receiving an error message. Saving the two tables, each one in a different file, they are correctly read.
There is a way to have an unique file?
I have a feeling that this isn't considered as a bug, because invalid JSON in files probably isn't a good thing to keep even for this situation..
I would combine the tables into a single temporary table to solve the issue. Like this:
Code: Select all
WriteTable(1, {t1, t2}, {Adapter = "default"})
Code: Select all
Local temp = ReadTable(1, {Adapter = "default"})
t1 = temp[0]
t2 = temp[1]
Re: readtable & json file
@JPV
You got it right. as usual a really elegant solution.
thanks
You got it right. as usual a really elegant solution.
thanks