Find and Replace with newline


#1

Is there a way to use a newline as a replacement character? Let’s say I have the following text:

Alabama, Alaska, Arizona, Arkansas, California, Colorado, Connecticut, Delaware

And I wanted it to be:

Alabama
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware

How I would normally do that is replace each , with newline, but Atom does not allow me to type one as far as I can tell. Some software (such as TextMate or TextEdit) will allow you to use opt+return to make a newline, so that might be an interface for it.


#2

If you turn on Regular Expression mode with the .* button on the right, you can type \n as the replacement string to replace the commas. You should also replace the trailing space after the comma at the same time to get exactly what you want.


#3

Very nice! Thanks for the support.


#4

Worked for me, thank you!


#5

Perfect, thank you.


#6

thanks! worked great


#7

Is there a place to file a bug where finding and replacing , with ,\n in regex mode locks atom up on very large json blobs?
I’d like to open an issue.


#8

You can put your issue over here, https://github.com/atom/atom/issues
It will take time to resolve it based on the severity of the issue.


#9

Very good, help me to save my work


#10

Thank you!


#11

Is there a way to search for line endings?


#12

Try using a regular expression: