Tips & Tricks

Using Text Editors to Replace New Lines w/ Comma

Using Vi

  1. Open the file in Vi editor
  2. Switch to command mode.
  3. To replace all newline characters with comma use
    :1,$s/\n/, /g
  4. Press Enter

Using NotePad++

  1. Open a NotePad++ window.
  2. Insert Find and Replace mode.
  3. Within the Find What field, enter the following:
    \r\n
  4. Within the Replace with field, enter a comma.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s