The following figure shows the problem of importing txt files to the database (using Navicat ).

Source: Internet
Author: User
: I have already saved coursera's data in a txt file with python crawler. I plan to import these files into the mysql database table (using navicat), and each txt stores a column of data, however, when I import the data, there is no way to match the left and right, but the output will be...

:


I have already saved coursera's data in a txt file by using python crawlers. I plan to import these files into a mysql database table (using navicat) and store one column of data in each txt file, however, when I actually import data, there is no way to match the left and right, but it will happen. In this way, the data content in my column cannot be matched and cannot be used, for example: the course subject cannot match the corresponding url one by one. Please help me! Thx!

Reply content:

:


I have already saved coursera's data in a txt file by using python crawlers. I plan to import these files into a mysql database table (using navicat) and store one column of data in each txt file, however, when I actually import data, there is no way to match the left and right, but it will happen. In this way, the data content in my column cannot be matched and cannot be used, for example: the course subject cannot match the corresponding url one by one. Please help me! Thx!

I have already saved coursera's data in a txt file by using python crawlers. I plan to import these files into a mysql database table (using navicat) and store one column of data in each txt file,

This is your own problem. It is common sense who makes your txt have only one field of data. Importing another txt will write another field in the new line. You can use navicat to export a txt file to see the normal format.

We recommend that you write another script to merge two fields in two txt files into two fields in a csv file, and then manually import mysql through navicat.

Or

Write a script to read two txt files and import them directly to mysql.

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.