发布网友 发布时间:2022-04-26 15:58
共1个回答
热心网友 时间:2023-10-13 05:35
@echo off&setlocal enabledelayedexpansion
for /f "delims=" %%i in (a.txt) do (set var=%%i !var!)
for %%i in (!var!) do echo %%i
pause>nul
批处理不是更简单嘛。 VBS脚本{微软的}:
Const ForReading = 1
Const ForWriting = 2
Dim arrLines()
i = 0
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("a.txt", ForReading)
Do Until objFile.AtEndOfStream
Redim Preserve arrLines(i)
arrLines(i) = objFile.ReadLine
i = i + 1
Loop
objFile.Close
Set objFile = objFSO.OpenTextFile("a.txt", ForWriting)
For i = Ubound(arrLines) to LBound(arrLines) Step -1
objFile.WriteLine arrLines(i)
Next
objFile.Close