Scripting Blog [archived]

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

How Can I Write a Script That Increments a Counter Each Time a Log File is Updated?

(image) Hey, Scripting Guy! How can I write a script that increments a counter each time a particular log file gets updated?-- HJ(image) (image) (image) Hey, HJ. You know, lately the Scripting Guy who writes this column has been victimized by a disturbing phenomenon: he keeps getting phone calls from machines. For the past several nights ...

How Can I Count the Number of Times a Word Appears in a Log File?

(image) Hey, Scripting Guy! How can I count the number of times the word Failure appears in a log file? There’s one catch, though: the log file simply writes its events one after another, creating one big, giant line of text.-- FS(image) (image) (image) Hey, FS. According to the rest of your email, your log file looks something like this...

How Can I Determine the 20 Largest Files on a Computer?

(image) Hey, Scripting Guy! How can I determine the 20 largest files on a computer?-- PW(image) (image) (image) Hey, PW. Having recently returned from a vacation in Europe, the Scripting Guy who writes this column now understands that there are different ways to do things. Some of these would be difficult to adjust to on a regular basis: ...