Creating a single-quoted comma separated line of text

Today I had a need to create a single line of text like this:

‘product1.jpg’, ‘product2.jpg’, ‘product3.jpg’

From a text blob that looks like this:


This text chunk, in this case, comes from a copy-and-paste from a “dir *.jpg” in a Windows XP command window.

There were actually only 6 image file names that I wanted to put into an array in PHP, but I had a feeling that I would be doing this type of task again, so I spent the time to build a tool for it.

So if you need to do something similar, please try the latest addition to Perceptus’ Web Tools site, the List to single quoted CSV Text Wizard (admittedly, we don’t save our best names for that site).  All you need to do is paste in a bunch of words, one per line, and you’ll get back the one line CSV.

I think this will be handy for creating source code for arrays in many languages, and also creating the bulk of the syntax for an IN () SQL statement.

Tags: , , , ,

Leave a Reply