473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

mysqlimport

Necesito importar a una tabla MySQL datos de un archivo de texto, donde los campos están seperados por tabuladores, pero el orden y cantidad de los campos en el archivo texto no coincide con el de la tabla MySQL.

¿Alguien conoce cómo conformar el comando com mysqlimport o con load data infile?

I need to import data fro text file to MySQL table, in text file field are separated by TABs, but field's order and quantity are not the same as in the MySQL table.

Somebody can help me to write instructions whit mysqlimport or with load data infile?
Jul 28 '06 #1
1 3639
ronverdonk
4,258 Expert 4TB
As far as I understand, fields in an input record of the file must have the same order as the table columns. So you could create a temporary table with the columns in the same order as the fields in each file-record. After importing you could then copy the contents of the temp table to the destination table.
As for the TABs, when you miss them at the end of the record, it wouldn't matter much, but if they are in the middle of the record you'd have a problem.

Ronald :cool:
Aug 1 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Daniel Kasak | last post by:
Hi all I have some data in Excel ( I didn't put it there - a customer did ). I'm setting up an import routine for it, with an Access front-end. I don't like the way Access imports Excel files,...
0
by: gord barq | last post by:
Hi, I'm importing ~2000 rows using mysqlimport with the following syntax: mysqlimport -d -v --ignore -u root -p .txt Connecting to localhost Selecting database Deleting the old data...
0
by: lynn | last post by:
Hello, I am installing some databases on the mysql databases of my mac osx 10.2.8 but when I do "mysqlimport -u X -p W (directory) *.txt.table" I am getting this answer: mysqlimport: Error:...
0
by: Tom | last post by:
Hi I am using the following command to import a csv file into my MySQL database but for some reason the first column in the CSV file is being ignored... any thoughts as to why this might be...
0
by: Dobsons | last post by:
What can I do to make this series run as like an executable? (I type in the file name and it runs these 9 mysqlimport commands) mysqlimport -df --fields-enclosed-by='"' --fields-terminated-by=, R...
0
by: Joseph Hill | last post by:
Hi I have a 300MB CSV file in with data in the following fashion: "AB10 1AF","39410","80640","QA28","SN9","Castlehill","Aberdeen City","Grampian","","49998","Not applicable","" "AB10...
0
by: Dave Hammond | last post by:
When using mysqlimport, the final statistics include a count of "Warnings", for example: Connecting to foo.whatever.com Selecting database foo Loading data from LOCAL file: foo_userInfo.imp...
0
by: moishyyehuda | last post by:
whey when I execute this statment cursor.execute("""mysqlimport merchandise 1.txt""") I get this error ProgrammingError: (1064, "You have an error in your SQL syntax. Check the manual that...
2
by: ibo3 | last post by:
I am having trouble trying to import a txt file. Can someone tell me what these errors are? -> mysqlimport --delete -c employeeID quarter initials Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.