Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Const ForReading = 1
- Const ForWriting = 2
- Set oFileSys = WScript.CreateObject("Scripting.FileSystemObject")
- Set oFolder = oFileSys.GetFolder(".")
- For Each file in oFolder.Files
- If Instr(file.name,".txt") > 0 Then
- Set objFile = oFileSys.OpenTextFile(file.path, ForReading)
- strText = objFile.ReadAll
- objFile.Close
- linesArray = Split(strText,vbCrLf)
- For each line in linesArray
- strNewText = strNewText & line & " | US" & vbCrLf
- Next
- strNewText = Left(strNewText,Len(strNewText)-2)
- Set objFile = oFileSys.OpenTextFile(file.path, ForWriting)
- objFile.Write strNewText
- objFile.Close
- strNewText = ""
- End If
- Next
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement