Comment by peterburkimsher

9 years ago

I write a lot of scrapers and parsers, and sed is great because it's fast and almost always pre-installed.

There's a script I use every day that takes the current date as an integer, calculates an offset, reads line of a Bible reading plan e.g. "Acts 19:1-20 Paul in Ephesus", gets the chapter number "Acts 19", and then links me to that file. I use sed to get the text between* the start and ":". I first wrote it in AppleScript on a Mac, but later I wanted to port it to a jailbroken iPhone. awk wasn't there, but sed was.

I also used sed for a Mac/Linux cross-platform script that scraped EPG data from MC2XML (information about TV guides). sed was faster than awk.

In practice these days I usually just use TextWrangler and find-replace with Regex, instead of writing a script.

* If you think you can do textBetween faster - please contribute your own implementation over on Rosetta Code.

http://rosettacode.org/wiki/Text_between

TextWrangler has now been sunsetted. :-(

https://www.barebones.com/products/textwrangler/