Friday, August 06, 2010
CRLF Hack
This is purely for those people who cut/paste things from emails and the like (where a forced hard-return is set after each line) and want to convert it so that that hard-return is removed. This is what I do:
1. find/replace all DOUBLE hard-returns with a weird character (I use ~~~). In my editor, EditPlus, that means setting regular expression on, and replacing \n\n with ~~~.
2. find/replace all SINGLE hard-returns with a space. That means \n becomes _ (where _ is really you hitting the spacebar once). Your whole document is now on one line.
3. find/replace all DOUBLE spaced with a single space. (Just in case step 2 added a space you didn’t want.)
4. find/replace ~~~ with DOUBLE hard-returns (to undo the damage of Step 1).
I figure there’s someone else out there that’s been bothered by this, and who ends up taking care of it manually. Now you have it a different way.


Recent comments
Older comments
Page 1 of 344 pages 1 2 3 > Last »Complete Archive – By Category
Complete Archive – By Date