May 28, 2005

Learning Text Factory – BBEdit

Posted in Mac OS X at 12:06 pm by intermediatemacintosh

BBEdit 8 came out with a new feature called Text Factory. It allows you to save a string of text transformations as a single step, that can then be repeated later on.
I probably could use this most everyday, but I’ve been procrastinating learning how to use it. However, today is the day I least get my feet wet.
Todays situation involves scraping a web page of keywords, from Overture/Yahoo. After I copy and paste into BBEdit, I need to remove some of the non ascii characters, as well as the number of expected searches.
First step, choose New Text Factory from the BBEdit File menu. Second step, choose the document to operate on. I’ll just choose the open file that contains the screen scrapings from running the above web page.
I want to run a couple of regular expressions to clean up the web page, leaving me with just the keywords. However, it does not look so simple to do. I have easy choices of a bunch of simple BBEdit menu comands, like changing case, or removing line numbers. But no walkthrough of a regular expression transformation. Looks like maybe I’ve got to set up an Applescript command first, and then invoke that from Text Factory.
More time than I want to spend today, so let me see if I can clean up my file using just the builtin BBEdit Text commands. I string together the Zap Gremlins command to get rid of the bullets, a remove line number command, and a sort lines command to do a decent job of cleaning up the file. I simply need to delete all the blank lines, and I could have gotten all but one deleted by choosing the Text command to process duplicate lines. Oh well, next time. It’s back to some productive work for me.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: