来个VBS,源文件为1.txt,去掉行尾空格后生成新文件为2.txt。- SourFile = "1.txt"
- TargFile = "2.txt"
- Set objFSO = CreateObject("Scripting.FileSystemObject")
- Set objSourTextStream = objFSO.OpenTextFile(SourFile, 1)
- Set objTargTextStream = objFSO.OpenTextFile(TargFile, 2, True)
- Do until objSourTextStream.AtEndOfStream
- strLine = objSourTextStream.ReadLine
- strLine = RTrim(strLine)
- objTargTextStream.WriteLine strLine
- Loop
复制代码
|