Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6168279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:39:36+00:00 2026-05-23T22:39:36+00:00

I currently have a .csv file with several unlabeled columns of data, which to

  • 0

I currently have a .csv file with several unlabeled columns of data, which to my knowledge translate to the following datatypes in sqlite:

  • datetime (in the format 7/19/2011 12:00:00 PM) -> numeric
  • double -> real
  • char(1) -> text
  • float -> real

I can create the database by doing the following:

sqlite> create table myTable (myVar1 numeric, myVar2 real, myVar3 text, myVar4 real);
sqlite> .separator ","
sqlite> .import myFile.csv myTable

Then I copy and paste the newly created myTable.db into the “assets” folder in my project in eclipse. I make a DatabaseHelper class that extends SQLiteOpenHelper, and then I can start using and reading from the database in my Android project.

Am I getting this right? I’ve never used a database before and I’ve seen so many vastly different instructions on doing this. Some of my questions are– do I have to label the columns of my .csv file? Is my .csv file not “simple” enough to just use .import and I’ll need to find a program to translate it? I’ve come across sites saying that I need to rename something (which I don’t seem to have) to “_id”, and I don’t know what this is, where this is, or how to do this, or if it’s even necessary, or what it’s for. What else am I missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T22:39:36+00:00Added an answer on May 23, 2026 at 10:39 pm

    I think you are getting it “right” except for that first datetime column. You should use the TEXT type, not a numeric type.

    Also, you can inspect your data after the import to see if all is well, especially with that datetime field:

    SELECT * FROM myTable ORDER BY RANDOM() LIMIT 10;
    

    UPDATE

    In response to the OP’s last comment: my understanding of how you store date(time) is that it depends on your context. So if the date in the flat file is in the format “7/19/2011 12:00:00 PM”, then without any transformation it’ll be imported as TEXT anyway.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a sproc that is exporting data to a csv file using
I currently have the following code to parse a csv file using the standard
Basically, I have data of several people contained in a .csv file. This spreadsheet
I currently have a CSV file which, when opened in Excel, has a total
I currently have a csv file that I'm parsing with an example from here:
I'm currently just starting my first Lua program and I have a .csv file
I have a large CSV data file -- ~1,444,000 rows of data -- that
I currently have the following code, which finds capital letters in a string 'formula':
Currently, I have a CSV file set out like this: Element,Weight Hydrogen,1 Oxygen,16 Eventually
I currently have a function that takes a csv file, and returns an array

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.