on-internet
← Community

How to create multiple files with different names and content using a comma-separated list without loops?

Stack Overflow ·

I have a comma-separated list of file names, and I want to create multiple text files in MySQL. Each file should contain some static text. For example, if my input is: 'file1,file2,file3,file4' I want to generate: /var/www/output/file1.txt containing "SomeContent" /var/www/output/file2.txt containing "SomeContent" /var/www/output/file3.txt containing "SomeContent" /var/www/output/file4.txt containing "SomeContent" I want to achieve this without using loops. I tried using SELECT INTO OUTFILE like this: SELECT "SomeContent" INTO OUTFILE "/var/www/output/file1.txt"; SELECT "SomeContent" INTO OUTF

Comments

Sign in or sign up to comment and upvote.

No comments yet.