This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Results: Scans READ_FILE and outputs all unique lines to WRITE_FILE. | |
' Assumes: Text file has been sorted alphabetically | |
' TODO: Universal search for line so file doesn't need to be sorted. | |
Dim READ_FILE, WRITE_FILE | |
READ_FILE = "C:\Input\textfile.txt" | |
WRITE_FILE = "C:\Output\textfile.txt" | |
Set fso = CreateObject("Scripting.FileSystemObject") | |
Set inputFile = fso.OpenTextFile(READ_FILE, 1) '1 = for reading |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Results: Looks at the names of all files in FOLDER_TO_SCAN, replacing any instance of STRING_TO_REPLACE with REPLACE_WITH in each filename. | |
Dim FOLDER_TO_SCAN, STRING_TO_REPLACE, REPLACE_WITH | |
FOLDER_TO_SCAN = "C:\Folder\to\scan\" | |
STRING_TO_REPLACE = "replace this" | |
REPLACE_WITH = "with this" | |
Dim fso, folder | |
Set fso = CreateObject("Scripting.FileSystemObject") | |
Set folder = fso.GetFolder(FOLDER_TO_SCAN) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Results: Prints a list of file names in FOLDER_TO_CHECK to the text file at OUTPUT_FILE_LOCATION | |
Dim FOLDER_TO_CHECK | |
FOLDER_TO_CHECK = "C:\Folder\to\list\" | |
OUTPUT_FILE_LOCATION = "C:\Temp\ListFileNames.txt" | |
Dim fs, logFile, folder | |
Set fs = CreateObject("Scripting.FileSystemObject") | |
Set logFile = fs.OpenTextFile(OUTPUT_FILE_LOCATION, 2) |
NewerOlder