Wednesday, August 01, 2007

Harry Potter Frustrations

Am I the only one who wishes he could do this:

cat hp7.txt | sed -e %s/round/around/g \
| sed -e %s/[.][^.]*(that had nothing to do with)[^.]//g \
> hp7_slightly_less_annoying.txt

I'm halfway through, and I'm off to bed now. I will doubtless finish it
tomorrow.

5 comments:

Unknown said...

Many lols. Can I quote this to my techie friends in a list email?

I do agree with you though - she rambles a bit in all the books, and there's nothing necessarily wrong with that (c.f. Tolkien, D. Adams...) but in the final part of a 7-part saga, you JUST WANT TO KNOW IF/HOW THEY KILL V--- :). I finished it a few days ago, and it's well worth sticking with the annoying lack of directness in the prose!

alsuren said...

Either you haven't read the command carefully enough, or I made an error in constructing it. It *should* be valid bash/sed

The command I speak of refers to her proof-reader failing to check for instances of 'round' that should (in my mind) be 'around', and constructions like 'He felt a cold in his stomach that had nothing to do with the ice-cream.' Which should just be plain *removed* to reduce cringing.

Unknown said...

I didn't read it carefully enough. I'm still getting to grips with regexps :)

Though I HAVE decided to track down a copy of Linux In A Nutshell, as I have lots of book vouchers to use up...

Unknown said...

O RLY?

... forgive me.

I finished HP7 last week. I don't know, I've come to expect this sort of meandering J.K., so it was no bother. I'm not reading her books to go anywhere (other than Voldemort's ultimate demise) so any meandering done is all for the good. Cringe to that. ;)

A phrase I kept catching was the peculiarly British "have done". Ah, well, it's your language, I'm just borrowing it.

alsuren said...

@stuart: Let's be fair: Unix regexps have the nastiest, most counter-intuitive syntax ever, but they're too "powerful" for anyone to drop, and there are too many perl programmers that think the syntax is really good and simple (which it probably is, compared to perl). I only use regexps with sed, and I try to make them as linear and straightforward as possible.

@jared: as in "Have done with it"? She does use that more than is usual. It's more "Weasley" than "British", in my association.

And what's this idea that everyone has about rambling? Her books ramble no more than my mind usually does... though I wasn't entirely convinced by the massive chunk of blatant Snape-based fanservice that she dropped right in the middle of the final battle sequence. (and don't try to tell me that that's a spoiler, because everyone knew that both were going to appear in the last book, but not that they were going to be inter-twined.