personal blog of Jonathan Fretheim

I got tired of copying a column of stuff from Excel, opening BBEdit, doing a find and replace to convert a bunch of lines into one block of comma-delimited text, selecting it all, copying again, and then finally pasting. I felt like I was that chump using an old fashioned blanket on the snuggie commercial.

So, I wrote this AppleScript.

clipboard newlines to commas and paste


  1. Copy a column of stuff (from Excel, Numbers, anything really)
  2. Go to where you want to paste it as comma-delimited
  3. Invoke the script!

On my system, I run it with a keystroke trigger defined in Quicksilver. But you could use LaunchBar…or activate it from the scripts menu. By the way, if you want a system-wide scripts menu, here is a page that describes a nice way of activating a bunch of menu extras in OS X.

[EDIT 11/16/2010: The script has been updated and is now much simpler. Rather than writing to a temp file, everything's done with one pipelined shell script.

Additionally, this version squeezes together multiple consecutive newlines and replaces them with one comma. If you need to preserve those as consecutive commas, remove the -s option from each of the two tr statements.

It also removes any trailing comma from the result. If you don't want it to do this, remove the sed section.

do shell script "pbpaste | tr -s '\\n' ',' | tr -s '\\r' ',' | 

     sed -e 's/,$//' | pbcopy"


Want to know if any libraries close to you have a particular book? Drag this link to your bookmarks bar:


While you’re browsing around and thinking about books, click it. Here’s what’ll happen when you do:

  1. If you are looking at a book on Amazon, it’ll take you straight to the WorldCat entry for that book. Magic!
  2. If you’re not looking at anything on Amazon, it’ll check to see if you have highlighted any text on the current page in your web browser (i.e., you’re reading book reviews in the New York Times and you highlight the name of a book, an author, etc.) and then search WorldCat for that text.
  3. If you’re not looking at anything on Amazon, and there is no text highlighted, you’ll be prompted to enter what you want to search for in WorldCat.

Slick, eh? If you haven’t used WorldCat before you’ll need to tell it your location so it can give you relevant results.

I think it’s handy. It isn’t perfect, though. For example, if you’re looking at an electric toothbrush on Amazon and click this, it’ll take you to WorldCat and WorldCat will say it has no idea what you’re looking for. There are probably some other conditions/edge cases/etc. I haven’t thought of. Let me know if you come up with anything I oughtta account for and I’ll give it a shot.

Paul Erdős playing ping pong with Fan Chung. Ronald Graham can be seen in the background jumping on a trampoline.

Video clip from George Csicsery’s film N is a Number

Audio clip from a remix of “Pop The Glock” by Uffie
“[Shoulder Lean Intro] Pop The Glock (Paul Devro remix)”

Paul Devro:
Young Dro:

Here it is, more or less. No, you can’t have the KML file or waypoint data because I just eyeballed that line. Click to enlarge.

Map of USA with line I drew on it using a mouse.


The trip is over. I rode a total of 4,765 miles this summer in a great zig-zagging arc across the United States.

There’s more to say about Philadelphia and arriving at the shore (both of which were inspiring moments), but I’ll say it all later. I’m in New York for a couple of days and I’ve shipped the bicycle back to California already. From here I’m headed to Boston by bus for two nights, and then to Champaign, IL by plane and will be there for about a week. Friends, I’ll be back in California the weekend of the 20th; let’s celebrate.

Well, I limped out of West Virginia with a cracked rear rim (screaming down foggy, rainy, steep descents), and got a new wheel in Cumberland, MD in the midst what was one of the most intense weeks of climbing I’ve had all summer. The mountains out west are taller, but the climbs are nowhere near as steep as they are throughout the Appalachians. The C&O Towpath was too muddy to use, so I took the Old National Pike one of the first grand east-west highways in the nation, which is now mostly empty because of the interstate highway system (paralleling I-68 and I-70 through western Maryland). More huge climbs. I’m not the first cross-country cyclist to think this, I’m sure, but I underestimated West Virginia and western Maryland. Pennsylvania I’m sure will have lots of ups and downs between here and Philadelphia.
I rode through Hagerstown and onto Frederick, MD and had a great visit with my cousin Eric and his wife Alex. Yesterday afternoon, I rode into Pennsylvania to catch up with an old friend. Today, on through York and toward Lancaster mostly using one of Pennsylvania’s signed cross-state bike routes about which I’ve read mixed reviews (route information link - I’ll be on route S across the southern tier of the state).
I’m fast approaching the end of this long trip. I’ll stay in Philadelphia through the weekend and then plan on riding through the pine barrens of New Jersey, up the Jersey shore, and then taking the 35 minute ferry from Atlantic Highlands (at the very northeast tip of the Jersey shore) to Manhattan. I’ll likely ship the bike home from somewhere close to the ferry terminal to simplify things in New York City. A couple of days there and then I’m homeward-bound, either on planes or trains–I haven’t decided yet. So far, I’ve ridden somewhere in the neighborhood of 4,500 miles.

The road was wet, the fog was thick, the coal trucks were in a hurry,
and the grade was steep; but I survived and now I'm having lunch at
the Chat 'n Chew on the Maryland side of US 220.

I'm 20-some miles out from Cumberland and a bike shop which can help
me diagnose and/or doctor up this back rim of mine. I'm also hoping
for the best.

Yes, that's me putting my finger through a giant hole in the sidewall
of my rear tire. And, yes, I'm in the creepiest motel room in all of
West Virginia. $24.58 after tax.

I rode through a 10 mile sliver of Maryland this afternoon and the
difference between the two states based on road conditions and first
impressions is serious. Tomorrow, I'm gladly headed for Maryland again.

I've mounted my spare tire, but this drama may not be
over. …grumble, grumble…beat-up rim from that rough trailriding a
few days ago…the rim may be a little…cracked…let's all hope for
the best at least until I can get somewhere with a bike shop…in

The traffic on US 50 died down significantly a few miles east of
Fellowsville (the sign for which had been vandalized to read
"Cranksville") and then the real climbing began. So far, I've had two
mountains to get over, each of which having 9% climbs for 3 miles up.
It's beautiful up here.

From here I'm aiming toward Frederick, MD to visit some family before
heading into PA and Philadelphia.

For most of the way between the Ohio River and Clarksburg, WV I used
the 72-mile North Bend rail trail which includes 9 dark, damp, echo-
filled, spooky tunnels. People have often asked me on this trip if I
get scared out there all by myself. Up until now I always said no
without a second thought. Those tunnels, though, were scarey. Some are
as short as 300 feet, but at least 3 of them were longer than 1000
feet, one nearly a half-mile long. Some had a couple inches of water
through long stretches, some had a couple inches of mud I tromped my
way through. I had to dismount and walk through many of them, and
there were a couple occasions when I couldn't see the light at either
end from the dark, dark middle. I bought fresh batteries for my
headlight at the only store in Cairo after the first tunnel.

The western half of the trail is in pretty good shape, but things get
rougher in the east. If I were to do it again, I don't think I'd use
the whole trail without some knobby tires. I was fine, but it was
rough riding in sections.

Yesterday, the rain (and the hills…and the narrow roads with coal
trucks) slowed things down for me and I only made it 32 miles to
Grafton. Today (through more rain), I'll hit the far western Maryland
state line and may end up in West Virginia again. West Virginia is the
only state which is entirely within a mountain range. I'm not seeing
any high peaks in this part of the state, but the terrain is rugged
and the ups and downs are steep and unrelenting.