Scripting Blog [archived]

Formerly known as the "Hey, Scripting Guy!" blog

How Can I Tell Whether a Phrase Occurs At Least Twice in a Text File?

(image) Hey, Scripting Guy! How can I tell whether or not the phrase 226 transfer complete occurs at least twice in a text file?-- JR(image) (image) (image) Hey, JR. You know, this was a tough one for us to answer; that’s because the Scripting Guys are always content with just one of everything. Take the Scripting Guy who writes this ...

How Can I Truncate Names to a Maximum of 16 Characters?

(image) Hey, Scripting Guy! How can I truncate names to a maximum of 16 characters?-- BN(image) (image) (image) Hey, BN. Brace yourself: it’s time for another trip down memory lane. When one of the Scripting Guys was going to college, he took a temporary summer job with the Green Giant Corporation, working in the office that oversaw the ...

How Can I Extract a Series of Characters Found in the Middle of a String?

(image) Hey, Scripting Guy! I have a series of strings that look something like this: xxxxyyyyyyxx. How can I extract just the y’s?-- JB(image) (image) (image) Hey, JB. And, yes, it is a Friday. But, hey, it’s just a coincidence that we happened to pick an easy question on a Friday, the day we’re itching to get out of here and go ...