mercredi 11 février 2015

Export SQL rows to multiple text files and name them

I have a database with 6 columns and several thousand rows in which I'd like to export the contents into separate, named text files.



id title text text_2
1 blah lorem ipsem... indigo violet...
2 gunf ipsem lorem... up down left...
3 faff sir I have a... amarillo albuquerque...


I'd like to create the following text files for each row:


filename = id - title.txt; content = title


filename = id - title.txt; content = text


filename = id - title.txt; content = text_2


I've looked and can't think how to do it. I used to use a macro in Excel to convert cells to txt but the text is too big for Excel's cell character limit.


I'm using SQLite but am not wedded to it (though would rather not have to buy a program if I can avoid it).


Any advice on what to do? While not too techy I can follow some basic code.


Aucun commentaire:

Enregistrer un commentaire