Pulling line breaks out of a giant text file and turning it into comma separated list

While there is probably a dozen ways to do this, I needed to today and I wanted to do it quick and easy. Figured this might help others, particularly if you were trying to take a big list of text entries and pull it into SharePoint for more meaningful data manipulation.


I wanted to take a giant list of Artists (that my band www.supersauce.ca covers) that I had already cleaned up for duplicates in Excel and turn it into a comma separated list that Facebook would accept.  Your needs may vary, but the requirement occurs for me often enough.

So What

So I had a big list like this (over 200 actually) that I massaged first in Excel to remove duplicates (We do quite a number of Journey songs for example).  This is just a sampling:

4 Non Blondes
A Flock Of Seagulls
Ace Of Base
Alabama Shakes
Bachman Turner Overdrive
Band Of Skulls
Big and Rich
Big Brother & The Holding Company
Big Sugar

But I wanted it to be like this…

4 Non Blondes, A Flock Of Seagulls, ABBA, Ace Of Base, Adele, Alabama Shakes, AWOLNATION, Bachman Turner Overdrive, Badfinger, Bahamas, Band Of Skulls, Big and Rich, Big Brother & The Holding Company, Big Sugar,

Now What

My approach was to use NotePad++ (donation ware) and perform the following, which worked a treat.

    • Choose Search… Replace
    • Search for:


  • Turn on Extended Search Mode
  • Replace with: , (and a space)

That did it, cut and paste into Facebook and on to the next thing in this Rock Star’s life.



4 responses to “Pulling line breaks out of a giant text file and turning it into comma separated list

    1. Argh. Thanks for pointing that out. Live Writer stripped it out and I didn’t notice (I had it right in the screenshot lower, not making it up 😉 Fixed now, thanks Rizzo.

  1. You can do the same thing in MS Word, by for ^p (paragraph end).
    If I want to make a csv from a columnar list, I usually look for 2 (^p^p) and replace these with some unusual character – tilde maybe. Now I have my line ends. Next, replace all of the single ^p with commas (to separate the fields) and lastly replace the unusual character (tilde?) with ^p. This will create a line end for each row. Save it to disk and open it with Excel to verify columns and rows, and to add column names if desired.
    Now, if this is imported into SharePoint, you will have a custom list of your data. I have done this with csv’s with thousands of rows – works fine.

Comments are closed.