How to insert a line break over 100 times for a given text string

newlinestext editingtext-editors

I got this very, very, very long text string that consists only of e-mail addresses. It's so long that it goes off my screen several pages to the right. It makes it impossible to read.

It looks something like

mail_address1@domain1.com; mail_address2@domain2.com; mail_address3@domain3.com; mail_address4@domain4.com; ......

I essentially want to convert it into a list. Each and every e-mail address is separated by a semicolon. I imagine I should be able to take advantage of this fact, maybe create some script or something that will insert a line break at each semicolon. I would also like the semicolons to be removed.

Can I use Notepad++ somehow?

How about Word 2010? Or Excel 2010?

There is a text import wizard in Excel 2010 that is able to recognize the semicolons as separators. But after clicking through the import guide the data is imported in columns rather than rows. So each e-mail address gets its' own cell in the first row.

There is no text import wizard in Word 2010, not that I'm aware of.

Best Answer

Notepad++

  1. Press Ctrl + H.

  2. Use the following settings:

    Find what:    ;        (with one trailing space)
    Replace with: \r\n
    Search Mode:  Extended
    Wrap around:  checked
    
  3. Click Replace All.

\r\n symbolizes a Windows newline, i.e., carriage return character followed by a linefeed character.

Word 2010

  1. Press Ctrl + H.

  2. Use the following settings:

    Find what:    ;        (with one trailing space)
    Replace with: ^l
    
  3. Click Replace All.

Again, ^l symbolizes a Windows newline.