I have a script that reads a text file and replaces a character string with a new string. The problem is that the data following the new string has spaces that are causing a problem. For example, here is how my data looks prior to running the script
Joe Manager Bob
Eric Manager Freddy
What I am doing is replacing the word Manager with a ; in order to import into Excel easier, making it delimited text. Problem I run into is the data following the ; which is column 2 in the spreadsheet, has leading spaces, which messes up the sorting capabilities.
I need to delete teh leading spaces so that the output text file looks like this:
Here is my script so far:
Const ForReading = 1 Const ForWriting = 2
Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile("C:Documents and SettingsadminDesktoptest_datamanager.txt", ForReading)
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!