Dfhaa_DK
Dfhaa_DK

Reputation: 131

importing CSV file in Google cloud sql only shows 1 row

I am trying to import a csv file that contains 5 columns and 100 rows. When I open the terminal and type SELECT * FROM cmc2 it only shows 1 row.

mysql> SELECT * FROM cmc2;
+--------------------------------+-------+------------+--------------------+--------+
| alt_name                       | price | market_cap | circulating_supply | volume |
+--------------------------------+-------+------------+--------------------+--------+
| Alt coin name;Price;Market cap |   554 |        714 |                630 |   NULL |
+--------------------------------+-------+------------+--------------------+--------+
1 row in set (0.01 sec)

this is my table that i created:

mysql> create table cmc2 (alt_name varchar(30), price int(20), market_cap int(20), circulating_supply int(20), volume int(20));

Upvotes: 2

Views: 562

Answers (1)

Chris32
Chris32

Reputation: 4961

As per the documentation "CSV files must have one line for each row of data and have comma-separated fields." So you should replace the semicolons in your file with commas.

This should be an easy task if you have a tool like Word, Excel, etc... Where you can do a search (Control + F) and select replace with... then import the CSV file with the required separator

Upvotes: 3

Related Questions