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.
TextWrangler has now been sunsetted. :-(
https://www.barebones.com/products/textwrangler/
I know :(
I don't want to pay for BBEdit though, and I'm still on 10.9 so the compatibility hasn't caused problems for me yet.
https://www.barebones.com/products/bbedit/faqs.html#no_licen...:
”Do I have to pay to use BBEdit?
No. You can use BBEdit without purchasing a license, in the same way you’ve been using TextWrangler (yes, for free). If you want BBEdit’s complete feature set (web authoring tools, and other exclusive features), you can purchase a license any time you like.”
They also claim that gives you more than TextWrangler’s feature set (https://www.barebones.com/products/bbedit/comparison.html). If they didn’t add nagging for upgrades, it seems they simply renamed TextWrangler to BBEdit.