I don't know if VBScript is the best solution for my problem so feel free to suggest other options. I have a text file containing 100K+ records. I would like to delete all rows in the file that start with a space or double-quotes (") or the words "Grand Total". Would a VBScript be the best option and if so, can someone help me with the script as I am clueless. I found the below script on the web -- is this something that I can use to adapt to my situation?
Dim fso As Object
Dim tsOld As Object
Dim tsNew As Object
Dim strLine As String
Const ForReading = 1
Const ForWriting = 2
Set fso = CreateObject("Scripting.FileSystemObject")
Set tsOld = fspenTextFile("c:\temp\DART\joined.csv", ForReading)
Set tsNew = fspenTextFile("c:\temp\DART\joined_new.csv", ForWriting, True)
Do While Not tsOld.AtEndOfStream
strLine = tsOld.ReadLine
If Left$(strLine, 1) <> """"" Then tsNew.WriteLine
Loop
tsNew.Close
tsOld.Close
Dim fso As Object
Dim tsOld As Object
Dim tsNew As Object
Dim strLine As String
Const ForReading = 1
Const ForWriting = 2
Set fso = CreateObject("Scripting.FileSystemObject")
Set tsOld = fspenTextFile("c:\temp\DART\joined.csv", ForReading)
Set tsNew = fspenTextFile("c:\temp\DART\joined_new.csv", ForWriting, True)
Do While Not tsOld.AtEndOfStream
strLine = tsOld.ReadLine
If Left$(strLine, 1) <> """"" Then tsNew.WriteLine
Loop
tsNew.Close
tsOld.Close