THE BOOK cover
The Unwritten Book is Finally Written!
An in-depth analysis of: The sacrifice bunt, batter/pitcher matchups, the intentional base on balls, optimizing a batting lineup, hot and cold streaks, clutch performance, platooning strategies, and much more.
Read Excerpts & Customer Reviews

Buy The Book from Amazon


SABR101 required reading if you enter this site. Check out the Sabermetric Wiki. And interesting baseball books.
MOST RECENT ARTICLES
MAIL : You ask | We say

Advanced


THE BOOK--Playing The Percentages In Baseball

<< Back to main

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.


(3) Comments • 2010/08/06 • Web Admin
Page 1 of 1 pages

<< Back to main