Tagged Questions
0
votes
1answer
40 views
Dealing with empty strings while loading a table from a CSV
I am trying to load a CSV file into a table. The CSV file contains some empty strings for example:
1,2,,4
I want to load the empty field as null. One way I know is to use \N i.e:
1,2,\N,4
but it ...
1
vote
2answers
74 views
Loading data in mysql using LOAD DATA INFILE, replication safe?
I am trying to load data into mysql database form CSV file. I found that we could use LOAD DATA INFILE command to do it. But as per the mysql documentation it is not replication safe. (See here)
Is ...
2
votes
1answer
278 views
excel sheet input to mysql
I want to add about 1000 records to a table that contains 31 fields.
The worst part is those 1000 records are in the form of an excel sheet having some columns left unfilled. Is there any easy way to ...
4
votes
1answer
217 views
MySQL Import CSV with Multiple Field Separators
I'm trying to import this CSV file into MySQL that appears to be optionally enclosed by more than one character. Unfortunately, MySQL only supports one character as a field separator.
I am stuck ...
1
vote
1answer
357 views
MySQL import csv only gets half the lines
I use the following command to read in a csv:
LOAD DATA INFILE '/Users/Tyler/Desktop/players_escaped.txt'
INTO TABLE players
FIELDS TERMINATED BY ','
ENCLOSED BY '^'
LINES TERMINATED BY '\n';
The ...
2
votes
2answers
3k views
MySQL - CSV UPDATE (not INSERT) into existing table?
I have a table with the following columns:
id | name | city
The table has 1000 entries in it.
I have a CSV file with a limited number of lines like this:
id,city
34,Denver
45,Kansas City
145,New ...
2
votes
3answers
301 views
What's the easiest way to re-format CSV exports from MySQL into Excel/ flat-file fields?
I've just had some database backup problems on a website I run containing some important lead data. Unfortunately, I've now lost one of the key MySQL tables, which means my data has lost its ...