如何批量将txt文本中每两行合并成一行且第一行在第二行之后

2025-03-22 23:41:40
推荐回答(2个)
回答1:

试试这个看看呀。

回答2:

@echo off
setlocal enabledelayedexpansion
set n=1
set fn=201407.txt
(for /f "tokens=*" %%i in ('type "%fn%"') do (
set /a n = 1 - !n!
if !n!==0 set s=%%i
if !n!==1 echo %%i !s!))>temp.txt
move /y temp.txt "%fn%"

 批处理的效率不是太高,如果文本文件太太处理的时间会比较长。