Android Question How to create sql table from csv file ?

Volga_

Member
I had seen the nearest question on https://www.b4x.com/android/forum/threads/load-csv-into-sqlite.9370/, but I want to create sql table from csv file, on which the first row of csv file is name of table columns (about 80 columns in my csv file).
This is example for csv file:
P.JPG

Please, tell me how to do this. Thanks.
 

Andrew (Digitwell)

Well-Known Member
Licensed User
Longtime User
Have you seen this?

 
Upvote 0

Volga_

Member
Have you seen this?

Yes, I have seen it. But I am working with B4A, not B4J. Can you support me more ? Thanks.
 
Upvote 0

Mariano Ismael Castro

Active Member
Licensed User
Yes, I have seen it. But I am working with B4A, not B4J. Can you support me more ? Thanks.
You should certainly explore what they recommended to you. I attached a small example (perhaps with defects) that could help you in what you are looking for.
It is mostly compilation of code. Overcoat by B4XTable
 

Attachments

  • CSV_To_SQLite.zip
    23.2 KB · Views: 129
Upvote 0

Volga_

Member
The project by @Mariano Ismael Castro is excellent, but it might be advanced for someone learning the first steps of importing a csv file into a SQLite table. If you find it somewhat advanced for you at this stage, come back, I will post you a complete project that wil simplify all that using the csv file that Mariano is using in his project.
Thanks Mahares, I want to have a simple version for learning, I'm very happy if you give me it.
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
I want to have a simple version for learning, I'm very happy if you give me it.
I sent you as PM a complete simple project to import a CSV file into a SQLite table. If it satisfies you and find it easy to learn, let me know so I can post it to the rest of the emmbers who are interested.
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
As promised, I created a simple B4XPages project with its details in the 'Examples' forum at the following link :
 
Upvote 0
Top