Find and Replace with Carriage Return

Something I do on a fairly regular basis is Find and Replace with Carriage Return. This little gem of information is so simple but so useful I thought I’d share it with you. When you have a big list extracted or exported from another application, you will frequently find that you have commas or spaces separating the items in the list. This is a bit annoying when you need to put the items into a vertical list i.e. a carriage return after each entry.

If your text editor supports regular expressions, it’s so easy. Perform a search/replace with your current separating character and replace it with \n . The standard programming representation for Carriage Return is backslash and ‘n’, this is used by the regular expression standard.

Leave a comment

1 Comments.

  1. Love your blog. Will be coming back quite a bit.

Leave a Reply


[ Ctrl + Enter ]