Loading |
VBScript |
JavaScript |
Powershell |
Search Options: Modify a Text File and Then Extract Selected Lines From the Modified ContentsContent of Modify a Text File and Then Extract Selected Lines From the Modified Contents.vbsMD5 Hash: EB1DFC636BEFA17C1EF8E9C2782937D2 |
||
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile("C:\Scripts\Test.txt", ForReading) strContents = objFile.ReadAll objFile.Close strContents = Replace(strContents, "~", "~" & vbCrLf) arrLines =Split(strContents, vbCrLf) For Each strLine in arrLines If Left(strLine, 2) = "N9" or Left(strLine, 2) = "B4" Then strNewFile = strNewFile & strLine & vbCrLf End If Next Set objFile = objFSO.CreateTextFile("C:\Scripts\Test2.txt") objFile.Write strNewFile objFile.Close | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |