Mysql Navicat import Excel table data

   1. Prepare the excel data table, the first line is the field name, and the second to fifth lines are the data (1. When the field to be stored is null, the corresponding cell is not written. 2. Note which worksheet the data is in, for example : The data in the following example is in the sheet1 worksheet 3. The field names in the excel table must be consistent with the field names in the database)

 

2. Then we open Navicat and select the table in the database to insert data (in this case, it is the person table, and the id is self-increasing, so there is no need to prepare id data)

 

3. Then we right-click the mouse and click the "Import Wizard" option.

4. Then select the format of the file to be imported, here I choose the Excel file (*.xls) format, and then click "Next".

 

5. As shown in the figure, click the Browse button on the right to find the Excel file to be imported.

 

6. After selecting the imported Excel file, check the Sheet where the field name and data are located (in this example, the field name and data are in Sheet1, so check Sheet1)

 

7. Then enter the value, the field name line indicates the number of rows corresponding to the field in the Excel sheet, mine is the first row, the first data row indicates the number of rows at the beginning of the data in the Excel sheet, my data starts at the beginning is on the second line

 

8. Then you can see the source table (the table containing the inserted data) and the target table (the table to be inserted into the data), and then click "Next"

 

9. Then you can see the fields to be inserted in the Excel table and the fields to be inserted in the person table, and then click "Next"

 

10. Select the additional import mode and click "Next"

 

11. Then click the "Start" button to start importing the data in the Excel table

 

12. When it prompts Finished successfully, it means that the additional data is successful, click the "Close" button

 

13. Open the person table, you can see the additional data

 

 

 

How does Navicat import txt text data

1. Prepare the txt data text. The first line is the field name, and the second to fifth lines are the data. In this example, commas are used to separate the data. Fields are fine (that is, data,, data) but not separated by spaces.  The field names in the txt text must be consistent with the field names in the database

Pay attention to the encoding format of the txt text, the default is ANSI encoding, and we need to modify it to UTF-8 encoding, otherwise there will be garbled characters after importing data

(1) Click on the file in the upper left corner of the txt text, and then select the "Save As" option

(2) At this time, there is an encoding drop-down box on the left of the "Save" button, and then select UTF-8 encoding, and then click the "Save" button.

 

 

2. Then we open Navicat and select the table in the database to insert data (in this case, it is the person table, and the id is self-increasing, so there is no need to prepare id data)

 

3. Then we click the right mouse button and click the "Import Wizard" option

 

4. Then select the format of the file to be imported, here I choose the text file (*.txt) format, and then click "Next".

 

5.  As shown in the figure, click the browse button on the right to find the txt file to be imported, and select UTF-8 as the encoding format. (The default encoding format of the txt text was ANSI before, so we have to modify the encoding format of the txt text to UTF-8 to keep the encoding consistent)

 

6. After selecting the txt text to be imported, click Next

 

7. Then select the record delimiter and the field delimiter. In this example, select CRLF----Carriage-Return Line-Feed to separate each row of data (CR----Carriage-Return, LF--- - Line-Feed newline)

In this example, commas are used to separate each field, so here select the comma (,) field separator If each field is separated by a space, select the space field separator

 

8. Then enter the value, the field name line indicates the number of lines corresponding to the field in the txt text, mine is the first line, the first data line indicates the number of lines at the beginning of the data in the txt text, and my data starts at the beginning is on the second line

 

9. Then you can see the source table (the table containing the inserted data) and the target table (the table to be inserted into the data), and then click "Next"

 

10. Then you can see the fields to be inserted in the txt text and the fields to be inserted in the person table, and then click "Next"

 

11. Select the additional import mode and click "Next"

 

12. Then click the "Start" button to start importing the data of the txt text

 

13. When it prompts Finished successfully, it means that the additional data is successful, click the "Close" button

 

14. Open the person table, you can see the additional data

Guess you like

Origin blog.csdn.net/chengshiruxia/article/details/112230204