我想将前两行从一个文件移到另一个文件中。有谁知道怎么样? file1.txt > file2.txt
答案 0 :(得分:0)
setlocal enabledelayedexpansion
set "count=2"
<file1.txt (
for /l %%i in (1,1,%count%) do (
set "line="
set /p "line="
echo/!line!
)
) >file2.txt
more +2 file1.txt > file3.txt
del file1.txt
ren file3.txt file1.txt