Search code examples
phpmysqlcsvhttp-redirectmodx

How to modify MySQL export to CSV?


I have MySQL table and I have to export two columns. I do that query now:

SELECT id,uri
FROM modx-sitecontent
INTO OUTFILE 'uris.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n';

But id in database it's an ordinary number, but in CSV I need something like this:

[[~id]]

For example in database 5 in CSV [[~5]]

Help me please


Solution

  • I use Google spreadsheets to modify CSV file and it's solved my problem