Using the Mesasqlite inbound CSV file

Source: Internet
Author: User
Tags sqlite database

This article is about the process of eventually storing Excel data in a SQLite database.

In my case, because the database update, need to re-do a full database, for the manager, it is obvious that Excel is the best choice, but to my side, and can not directly use the Excel file, in view of the large amount of data in Excel file, the ape can not go to insert data to build the library, So there are all the following.

1. Convert the Excel file into a CSV file (comma-separated values)

After you get the CSV file, do not worry, avoid coding problems, it is best to open the CSV file in TXT format, and save it as a TXT file .

The original Excel file, the exported CSV file, and the last TXT file. OK, the basic data file is ready, and the Database Operations section begins below.

2. Use Mesasqlite to put TXT file contents into storage

Open Mesasqlite, we need to create a new database first

  

Named full amount, put on the desktop, click Save

  

We can see that there is a suffix named Rdb on the desktop, we can directly modify the prefix name is DB, also do not change.

  

Open to see the full picture:

  

New Table

  

Add a field to a table

  

Final table structure

  

The next step is the key:

We click Import on the menu bar, and select the table that you just built

  

Then select the TXT file that was placed on the desktop before the result

  

Then, a. Use the ' delimiter to display the field in a branch

B. Drag the right-hand field corresponding to the left field

C. Click the red dot to select it

D. Click Import

  

If there is no exception, the display successfully inserted XX bar data, the last display:

  

Complete.

Exit the database and use the terminal to open the database with SQLite3:

  

Using the Mesasqlite inbound CSV file

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.