Showing tag results for text files

Feb 8, 2005
Post comments count0
Post likes count0

How Can I Find and Replace Text in a Text File?

ScriptingGuy1

Hey, Scripting Guy! From the command line, how can I use a script to open a file and replace text; for example, how can I replace all instances of “Jim” with “James”?-- JW Hey, JW. As we’ve found out numerous times when dealing with text files, there is no obvious way to do this; that is, there is no ReplaceText command that can open a text file...

Scripting Guy!scripting techniquesVBScript
Jan 25, 2005
Post comments count0
Post likes count0

How Can I Read Just a Single, Specified Line from a Text File?

ScriptingGuy1

Hey, Scripting Guy! How can I read only a specific line in a text file? For example, how can I write a script that reads only line 16 in a text file and then stores the value of that line in a variable?-- DL Hey, DL. You know we haven’t answered a question about text files in awhile, and that’s not something we should brag about; after all, it s...

Scripting Guy!scripting techniquesVBScript
Jan 18, 2005
Post comments count0
Post likes count0

How Can I Make a Read-Only File Writeable?

ScriptingGuy1

Hey, Scripting Guy! Is it possible to use a script to change the read-only attribute of a file?-- ZO Hey, ZO. Of course, you can do this; the FileSystemObject can do anything! Well, OK, it can’t do either of those things. And, no, it can’t do that, either. But it can change a read-only file to a writeable file, and with just a few lines of code....

Scripting Guy!scripting techniquesVBScript
Dec 1, 2004
Post comments count0
Post likes count0

Can I Combine Multiple Text Files Using a Script?

ScriptingGuy1

Hey, Scripting Guy! From the command prompt the command copy a.txt+b.txt ab.txt will take the contents of a.txt and the contents of b.txt and combine them into a new file named ab.txt. Can I do the same thing with a script?-- DL Hey, DL. In yesterday’s column we dealt with text files; more specifically, we talked about how you can use a script t...

Scripting Guy!scripting techniquesVBScript
Nov 30, 2004
Post comments count0
Post likes count0

Can I Edit .INI Files Using a Script?

ScriptingGuy1

Hey, Scripting Guy! Can I edit.INI files using a script?-- MZ Hey, MZ. Yes, you can edit .INI files (or any kind of text files, for that matter) using a script. The method you have to use might not be the most elegant process in the world, but it’ll work. And that’s all we really care about, right? Before we get into the whys and wherefores of e...

Scripting Guy!scripting techniquesVBScript