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

Filter posts by...

 

Friday, August 06, 2010

CRLF Hack

By Tangotiger, 10:24 AM

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

Latest...

COMMENTS

May 25 19:41
What sabermetrics is NOT

May 25 19:41
Pete Palmer’s new book: Basic Ball

May 25 19:38
“Why Kickstarter works”

May 25 17:32
Largest demonstration in Canadian history?

May 25 16:59
Howard Stern

May 25 15:12
Do pitcher’s reach back for velocity when needed?

May 25 12:51
Chad Curtis

May 25 11:26
Lack of hustle during a game

May 25 10:58
Rooting for laundry

May 25 02:38
NFLPA lawsuit against collusion

THREADS

August 06, 2010
CRLF Hack