?
Solved

MySQL Text Import issue

Posted on 2014-03-12
5
Medium Priority
?
429 Views
Last Modified: 2014-03-24
Hi,

I am trying to import around 4000 lines from a text file into a mysql. Below is a sample from the files

There are 3 Columns in the Table - Name, DN and Description

EM Phone                             **5014                                 EM Phone
EM Phone                             **5015                                 EM Phone
EM Phone                             **5016                                 EM Phone
EM Phone                             **5017                                 EM Phone
EM Phone                             **5018                                 EM Phone
EM Phone                             **5019                                 EM Phone
EM Phone                             **5020                                 EM Phone
EM Phone                             **5021                                 EM Phone
EM Phone                             **5022                                 EM Phone
EM Phone                             **5023                                 EM Phone
EM Phone                             **5024                                 EM Phone

I do the import based on tab seperation into MySQL however this is how it appears. What should be my Name and DN are put into the single Column and the rest is left out.

| EM Phone                             **5014                  | NULL | NULL        |
| EM Phone                             **5015                  | NULL | NULL        |
| EM Phone                             **5016                  | NULL | NULL        |
| EM Phone                             **5017                  | NULL | NULL        |
| EM Phone                             **5018                  | NULL | NULL        |
| EM Phone                             **5019                  | NULL | NULL        |
| EM Phone                             **5020                  | NULL | NULL        |
| EM Phone                             **5021                  | NULL | NULL        |
| EM Phone                             **5022                  | NULL | NULL        |
| EM Phone                             **5023                  | NULL | NULL        |
| EM Phone                             **5024                  | NULL | NULL        |

I am new to MySQL so I would appreciate if someone could tell me how I can import my data correctly.

Thanks in advance!
0
Comment
Question by:mark_06
  • 2
  • 2
5 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39925250
Are you importing it directly into MySQL from the text file?
Do the columns match up and in the same order?
0
 
LVL 6

Author Comment

by:mark_06
ID: 39925309
Yes I am importing directly from the text file into MySQL. The columns are in the same order and appear to match up from what I can tell. I can import the file into Excel (for testing it needs to do it automatically) and it works ok.
0
 
LVL 58

Expert Comment

by:Gary
ID: 39925382
Can you do an export of the table structure and post here and attach some sample rows from your text file (don't post them I need them in the exact same format as you have them)
0
 
LVL 27

Accepted Solution

by:
skullnobrains earned 2000 total points
ID: 39932653
post a few sample lines as requested above, and the 'load data infile' statement you are using as well

my guess would be
- your file is not tab-separated or you did not specify tab as the separator
- the end of the rows containing the descriptions are missing because they are beyond the field's size
0
 
LVL 6

Author Closing Comment

by:mark_06
ID: 39950191
Tabs were not separated correctly
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In today's business world, data is more important than ever for informing marketing campaigns. Accessing and using data, however, may not come naturally to some creative marketing professionals. Here are four tips for adapting to wield data for insi…
Measuring Server's processing rate with a simple powershell command. The differences in processing rate also was recorded in different use-cases, when a server in free and busy states.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses
Course of the Month16 days, 22 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question