Showing results for text files - Scripting Blog [archived]

Feb 9, 2006
Post comments count0
Post likes count0

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

ScriptingGuy1
ScriptingGuy1

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 Hey, FS. According to the rest of your email, your log file looks something like this:Failure 2/7/2006 8:25 AM Failure 2/7/2...

Scripting Guy!scripting techniquesVBScript
Jan 3, 2006
Post comments count0
Post likes count0

How Can I Remove All the Blank Lines from a Text File?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! How can I remove all the blank lines from a text file?-- RE Hey, RE. You know, back in the year 2002, when the Scripting Guys were still just lowercase scripting guys, we began working on the Microsoft Windows 2000 Scripting Guide. In putting together the book we faced enormous resistance from people who thought it was a mist...

Scripting Guy!scripting techniquesVBScript
Dec 6, 2005
Post comments count0
Post likes count0

How Can I Print Text Files to a Printer Other than the Default Printer?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! How can I print text files to a printer other than the default printer?-- JD Hey, JD. Boy, talk about pride going before the fall. When we first set out to answer this question we already “knew” how to solve the problem. We were well aware that the Shell object provides a way for you to print text files to the default printer...

Scripting Guy!scripting techniquesVBScript
Nov 15, 2005
Post comments count0
Post likes count0

How Can I Use ADO to Read a Text File Where All the Data is on a Single Line?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! I have a fixed-width text file which includes first name (6 characters), last name (13 characters), and department (9 characters) all on a single line. How do I read that using ADO?-- DW Hey, DW. Well, to be perfectly honest, we don’t think you can read a file like this using ADO (ActiveX Data Objects). ADO is a fantastic way...

Scripting Guy!scripting techniquesVBScript
Oct 21, 2005
Post comments count0
Post likes count0

How Can I Read a Text File on a Remote Computer?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! How can I read a text file on a remote computer?-- BM Hey, BM. We have a confession to make: we’re using you and your question for our own nefarious purposes. Earlier this week we answered a question about reading the last line in a group of text files; in our answer we promised we’d show people how to use the FileSystemObjec...

Scripting Guy!scripting techniquesVBScript