Sign in
TechNet Blogs
Technet Blog Images
More ...
Browse by Tags
TechNet Blogs
>
Hey, Scripting Guy! Blog
>
All Tags
>
filesystemobject
Server & Tools Blogs
>
Server & Management Blogs
>
Hey, Scripting Guy! Blog
All About Windows Server
Windows Server
Windows Server Essentials Blog
Building Clouds
Partner & Customer Solutions
Server & Cloud
Ask The
Performance Team
Ask Premier Field Engineering
Ask the Core Team
Cloud & Datacenter Management
The System Center Team Blog
System Center Virtual Machine Manager
System Center Service Manager
System Center Operations Manager
System Center Data Protection Manager
System Center Orchestrator
Partner & Customer Solutions
Client Management
System Center Configuration Manager
System Center Service Manager
MDOP
Malware Protection Center
Windows Intune
SUS
Partner and Customer Solutions
Virtualization, VDI & Remote Desktop
Virtualization Team Blog
Ben Armstrong’s Virtualization Blog
Jose Barreto Blog on Hyper-V
Partner & Customer Solutions
Remote Desktop Services
Windows Multipoint Server
Ask the Core Team on Hyper-V
File & Storage & High Availability
File & Storage
Jose Barreto
Partner & Customer Solutions
Ask the Core Team on Failover Cluster
Clustering & High Availability
Windows Server Management
PowerShell
Hey Scripting Guy (PowerShell)
Server Manager
Group Policy
Networking
Identity & Access
Ask Directory Services
Active Directory
Microsoft Leadership
Brad Anderson - In the Cloud
Hey, Scripting Guy! Blog
Learn about Windows PowerShell
Live Now on Server & Tools Blogs
Subscribe
Comments
Contact
Menu
Blog Home
Atom
Translate this page
Powered by
Microsoft® Translator
Twitter Feed
Recent Posts
PowerTip: Find Format Data Used by Current PowerShell Session
Posted
2 hours ago
by
The Scripting Guys
0
Comments
Variable Substitution in a PowerShell Script Block
Posted
14 hours ago
by
The Scripting Guys
2
Comments
PowerTip: Create a PowerShell Script Block on the Fly
Posted
1 day ago
by
The Scripting Guys
0
Comments
PowerShell Hash Tables that Contain Keywords...hmm...
Posted
1 day ago
by
The Scripting Guys
3
Comments
Tags
arrays hash tables and dictionary objects
associators of
CSV and other delimited files
Excel spreadsheet
Excel.Application
files
folders
Microsoft Excel
Office
retrieving input
running
Scripting Guy!
scripting techniques
shell.application
storage
string manipulation
text files
VBScript
Web pages and HTAs
WMI
Related Resources
Script Center Home
Scripting Library
Learn to Script
Script Repository
Scripting Forum
2012 Scripting Games
Archives
Archives
May 2013
(47)
April 2013
(61)
March 2013
(62)
February 2013
(56)
January 2013
(62)
December 2012
(62)
November 2012
(68)
October 2012
(62)
September 2012
(62)
August 2012
(63)
July 2012
(32)
June 2012
(39)
May 2012
(33)
April 2012
(97)
March 2012
(44)
February 2012
(31)
January 2012
(31)
December 2011
(31)
November 2011
(30)
October 2011
(31)
September 2011
(30)
August 2011
(31)
July 2011
(31)
June 2011
(30)
May 2011
(31)
April 2011
(97)
March 2011
(41)
February 2011
(28)
January 2011
(31)
December 2010
(31)
November 2010
(30)
October 2010
(31)
September 2010
(30)
August 2010
(33)
July 2010
(31)
June 2010
(30)
May 2010
(67)
April 2010
(65)
March 2010
(34)
February 2010
(29)
January 2010
(23)
December 2009
(23)
November 2009
(22)
October 2009
(23)
September 2009
(22)
August 2009
(25)
July 2009
(24)
June 2009
(38)
May 2009
(22)
April 2009
(22)
March 2009
(22)
February 2009
(20)
January 2009
(22)
December 2008
(8)
November 2008
(17)
October 2008
(9)
September 2008
(8)
August 2008
(6)
July 2008
(5)
June 2008
(21)
May 2008
(21)
April 2008
(22)
March 2008
(21)
February 2008
(21)
January 2008
(22)
December 2007
(10)
November 2007
(20)
October 2007
(23)
September 2007
(19)
August 2007
(23)
July 2007
(21)
June 2007
(21)
May 2007
(22)
April 2007
(21)
March 2007
(22)
February 2007
(21)
January 2007
(21)
December 2006
(11)
November 2006
(20)
October 2006
(22)
September 2006
(20)
August 2006
(23)
July 2006
(20)
June 2006
(22)
May 2006
(22)
April 2006
(20)
March 2006
(23)
February 2006
(20)
January 2006
(21)
December 2005
(16)
November 2005
(20)
October 2005
(21)
September 2005
(21)
August 2005
(23)
July 2005
(20)
June 2005
(22)
May 2005
(21)
April 2005
(21)
March 2005
(22)
February 2005
(20)
January 2005
(21)
December 2004
(16)
November 2004
(20)
October 2004
(21)
September 2004
(21)
August 2004
(22)
More
▼
Less
▲
Tagged Content List
Blog Post:
Hey, Scripting Guy! How Can I Remove Duplicate Values From a Pair of Text Files?
ScriptingGuy1
Hey, Scripting Guy! I have two text files that contain numbers. I need to write a script that can determine whether a given number exists in both of these text files. If it does, I need to delete that line from each of the two files. How do I do that? -- KT Hey, KT. Before we get started today, we...
on
14 Dec 2007
Blog Post:
Hey, Scripting Guy! How Can I Replace Text That Includes Double Quote Marks and a Tab Character?
ScriptingGuy1
Hey, Scripting Guy! I read one of your columns on replacing text in a file and I found it very useful. However, I have a somewhat more-complicated need: I want to replace text that includes both double quote marks and a tab character. How can I do that? -- FC Hey, FC. Your know, as anyone who’s ever...
on
11 Dec 2007
Blog Post:
How Can I Copy Selected Columns From a CSV File to an Excel File?
ScriptingGuy1
Hey, Scripting Guy! How can I copy selected columns from a CSV file to an Excel file? -- MdP Hey, MdP. One thing that people always worry about (and rightly so) is that one of these days the Scripting Guys will do something that tears a hole in the space-time continuum. Some of you might be concerned...
on
4 Jun 2007
Blog Post:
How Can I Convert a Tilde-Delimited File to Microsoft Excel Format?
ScriptingGuy1
Hey, Scripting Guy! How can I convert a tilde-delimited file to Microsoft Excel format? -- JN Hey, JN. You know, to tell you the truth we’re beginning to rethink our approach to this column. After all, usually we tell people how easy things are, and how – without much effort – they can write a script...
on
5 Dec 2006
Blog Post:
How Can I Extract Information Located Between Two Known Values in a Text File?
ScriptingGuy1
Hey, Scripting Guy! In a text file, how can I extract the information that appears between the string HOSTNAME= and a blank space? -- B Hey, B. You’ll have to pardon us if we seem a little sluggish today; we’re still recovering from all the fun and excitement of Windows PowerShell Week. What if you...
on
14 Nov 2006
Blog Post:
How Can I Clear the Contents of Any File Dropped on My Script Icon?
ScriptingGuy1
Hey, Scripting Guy! How can I write a script that will clear the contents of any file that I drag and drop on the script icon? -- SN Hey, SN. Say, you didn’t by any chance misplace a few hundred thousand insects did you? OK; just thought we’d ask. This past weekend the Scripting Guy who writes this...
on
17 Oct 2006
Blog Post:
How Can I Remove Double Double Quotes From a Text File?
ScriptingGuy1
Hey, Scripting Guy! I have a comma-separated values file that has data similar to this: data1",""data2"","data3",""data4"". As you can see, some of the items are enclosed by two sets of double quote marks (like ""data2""). How can I remove one of those sets of double quote marks, leaving the item looking...
on
15 Aug 2006
Blog Post:
How Can I Move the Oldest File in a Folder to a Different Folder?
ScriptingGuy1
Hey, Scripting Guy! How can I move the oldest file in the folder C:\Upload to C:\Download? -- DD Hey, DD. Funny you should mention the word “oldest.” The Scripting Guy who writes this column recently attended a family reunion and, for the first time ever, came face-to-face with the whole idea of getting...
on
26 Jul 2006
Blog Post:
How Can I Get a Script to Delete Itself?
ScriptingGuy1
Hey, Scripting Guy! I have a script for installing a printer that I give to my end users. When the script finishes, I’d like it to be able to delete itself. How can I get a script to delete itself? -- EA Hey, EA. You know, that’s an interesting idea: disposable scripts, just like disposable razors...
on
24 May 2006
Blog Post:
How Can I Remove Blank Spaces Before and After a String Value?
ScriptingGuy1
Hey, Scripting Guy! We have a custom in-house application that writes data to a log file. The problem is that the data often has a bunch of blank spaces before and after it. How can I remove all the blank spaces that come before and after my data? -- KS Hey, KS. You might find this hard to believe...
on
3 May 2006
Blog Post:
How Can I Print Just the Text Area of an HTA?
ScriptingGuy1
Hey, Scripting Guy! I have an HTA where information gets written to a text area. How can I print just the information found in that text area? -- DS Hey, DS. We want you to level with us here: are the Scripting Guys dead? We ask that because we saw the movie The Sixth Sense a few years ago and we...
on
27 Apr 2006
Blog Post:
How Can I Open a Text File as Unicode?
ScriptingGuy1
Hey, Scripting Guy! I have some text files that include Unicode characters. When I try to open those files using a script all I get back is gibberish. How can I open a text file as Unicode? -- FA Hey, FA. You know, the truly great magicians don’t concoct elaborate tricks that rely on trap doors, secret...
on
19 Apr 2006
Blog Post:
How Can I Count the Number of Words in a Text File?
ScriptingGuy1
Hey, Scripting Guy! How can I count the number of words in a text file? -- LA Hey, LA. You know, this is one of those questions where the Scripting Guys outsmarted themselves. (Not that outsmarting the Scripting Guys is particularly hard to do, mind you.) For one thing, we’re writing this column on...
on
3 Apr 2006
Blog Post:
How Can I Read Just the Last Line of a Text file?
ScriptingGuy1
Hey, Scripting Guy! How can I read just the last line of a text file? -- BM Hey, BM. You know, if you’ve ever wondered how Hey, Scripting Guy! differs from other daily columns (like, say, Dear Abby ), well, here’s one way. Suppose someone writes Dear Abby and says this: Dear Abby: My life is all...
on
3 Mar 2006
Blog Post:
How Can I Determine the Drive Letter for the Drive My Script is Currently Running On?
ScriptingGuy1
Hey, Scripting Guy! I have a script that runs off a CD and copies a bunch of files to a computer. However, in order to copy the files I need to know the complete file path, including the drive letter. How can I determine the drive letter for the drive my script is currently running on? -- RKG Hey...
on
7 Feb 2006
Blog Post:
How Can I Delete a Backup File Created on the Previous Day?
ScriptingGuy1
Hey, Scripting Guy! Each day we have a program that creates a file with a name similar to this: backup_20050607.bak. How can I delete the previous day’s file? -- JC Hey, JC. Hmmm, a script that goes out and automatically deletes whatever happened the day before. Boy, could we have used a script like...
on
25 Oct 2005
Blog Post:
How Can I Read a Text File on a Remote Computer?
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...
on
21 Oct 2005
Blog Post:
How Can I Unhide All the Files in a Folder?
ScriptingGuy1
Hey, Scripting Guy! How can I run a script to unhide all the files in a folder? -- GA Hey, GA. You know, when one of the Scripting Guys was a bit younger he and the other kids in his neighborhood spent countless hours playing variations on hide-and-seek; in fact, this Scripting Guy still has vivid...
on
23 Aug 2005
Blog Post:
How Can I Search for Two Items in a Text File?
ScriptingGuy1
Hey, Scripting Guy! You’ve shown us how to search a text file for a single word or phrase, but how can I search a text file for two phrases? I need to know if a file contains either Windows 2000 or Windows XP . -- JR Hey, JR. You know, it’s hard enough to get the Scripting Guys to do one thing; getting...
on
1 Aug 2005
Blog Post:
How Can I Add a Line to the Top of a Text File?
ScriptingGuy1
Hey, Scripting Guy! How can I add a line to the top of a text file? -- FT Hey, FT. You know, at one point in his career Sir Arthur Conan Doyle actually killed off Sherlock Holmes, figuring he’d written everything anyone could ever write about the master detective. Public outcry soon made him change...
on
30 Jun 2005
Blog Post:
How Can I Determine the Size of the My Documents Folder?
ScriptingGuy1
Hey, Scripting Guy! How can I determine the size of the My Documents folder? -- SC Hey, SC. The My Document folder is actually just another folder on the hard disk, one with a path similar to this: C:\Documents and Settings\kenmyer\My Documents. Of course, the actual path will vary depending on the...
on
31 Mar 2005
Blog Post:
How Can I Tell Whether a Web Page is Accessible?
ScriptingGuy1
Hey, Scripting Guy! How can I tell whether or not a Web page is accessible? -- JW Hey, JW. To tell you the truth, these are the kinds of questions we hate, questions where we don’t know the answer off the top of our heads but where it seems like there ought to be a way to do this. Sometimes in the...
on
22 Feb 2005
Blog Post:
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...
on
30 Nov 2004
Blog Post:
How Can I Create a CSV File?
ScriptingGuy1
Hey, Scripting Guy! How can I create a CSV file? -- LF Hey, LF. For those of you who aren’t up on your acronyms, CSV is short for comma-separated-values file, a text file in which individual elements are separated by commas. For example, say you have a CSV file consisting of user first names, last...
on
28 Oct 2004
Blog Post:
How Can I Read in IP Addresses and Use Them in a Script?
ScriptingGuy1
Hey, Scripting Guy! I have a text file that contains a bunch of IP addresses. I’d like to be able to read these addresses from a script, and then use them to connect to those computers. Is that possible? -- RL Hey, RL. You bet you can do this, and here’s how. First, make sure your text file looks...
on
9 Sep 2004
Page 1 of 1 (25 items)