Export a SQL database into a CSV file and use it with WEKA
- by Simon
How can I export a query result from a .sql database into a .csv file? I tried with
SELECT *
FROM players
INTO OUTFILE 'players.csv'
FIELDS TERMINATED BY ','
LINES TERMINATED BY ';';`
and my .csv file is something like:
p1,1,2,3
p2,1,4,5
But they are not in saparated columns, all are in 1 column.
I tried to create a .csv file by myself just to try WEKA, something like:
p1 1 2 3
p2 1 4 5
But WEKA recognizes p1 1 2 3 as a single attribute.
So: how can I export correctly a table from a sql db to a csv file? And how can I use it with WEKA?