different paths for tables

albgreco

Member
Licensed User
Longtime User
I would need to load csv tables that are in different paths.
If I do

filename="../../WM_Administrat2 My Documents/oggetti.csv"

and then

table1.Clear
table1.loadcsv(filename, ";", true, true)
numcol=table1.colcount

it seems to load the table but I get an incorrect table load (it seems to start from the third line of the file and I get a wrong columns number)

Note that it is not an issue concerning the csv file format because if I put the very same file in the same path where the application starts, all is right.

How to use different folders for storing/retrieving csv tables?

Thanks
 

Mr_Gee

Active Member
Licensed User
Longtime User
I think it is because you are recreating the columns
try if this works :
B4X:
'first file 
filename="File1.csv"
'create columns
table1.loadcsv(filename, ";", true, true)
'do not create them
filename="File2.csv"
table1.loadcsv(filename, ";", true, false)
 

albgreco

Member
Licensed User
Longtime User
...it does'nt work, it gives the error message

"Column number and type do not match data file" :confused:
 

Mr_Gee

Active Member
Licensed User
Longtime User
what happens if you create a new table and compare the two...
something isn't correct ...
 

albgreco

Member
Licensed User
Longtime User
I don't understand what was wrong... I rewrote all the code and now it works!
At least now I am sure that including "/../.." etc. in the filename it's the right way to make refernce to files in different paths.

Thank you very much :)
 
Top