Given a file which contains new lines, using Textmate, how can i remove them from the document
Given a text file
a
b
c
I'd like to end up with
a
b
c
I would use the regular expression ^\s*$\n
which will match any line that is empty or contains only whitespace characters.
Just run Replace All with that in the Find box, and with the replace box empty.
Replace "\n+" with "\n" (be sure that "regular expression" checkbox is on). This replaces several consecutive linebreaks with only one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With