csv to sql

gjoisa

Active Member
Licensed User
Longtime User
Is it possible to convert .csv file to sql database ? And how to get database from emulator which we created through Basic4android ?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You can copy files from and to a connected device / emulator with the 'ddms' tools.
It is located under <android-sdk>\Tools\ddms.bat.

Then press on the emulator and choose Device - File Explorer.

ddms_1.png


About the CSV file. You can easily parse a CSV file with StringUtils.LoadCSV.
Then you should go over the list of strings arrays and and insert the data to a SQL table. It is recommended to create one transaction for all the inserts.
 
Upvote 0

alfcen

Well-Known Member
Licensed User
Longtime User
...or, please google for the free "SQLite Database Browser" which is capable of importing CSV.
 
Upvote 0

gjoisa

Active Member
Licensed User
Longtime User
Tried to load csv file . I used the code like this ;

dim su as StringUtils
dim table as List
lstplace as ListView
....
table=su.LoadCSV(File.DirAssets,"Adi.csv",",")
lstplace.Clear
For i=0 To table.Size-1
lstplace.AddSingleLine(table.Get(i))
Next
.

But while running , the list shows "[Ljava.lang.String;@43ea9b50"
and so on . What to do get the actual text which is in csv file ?
 
Upvote 0

Merlot2309

Active Member
Licensed User
Longtime User
Hello,

For Mozilla Firefox there is a plugin "SQLite Manager" which works great for importing csv-files (also SQL and XML).

Helen.
 
Upvote 0
Top