Batch - Zigzag merging with two files
问题 I would like to make a zigzag merging of two text files as following. I have two files in input: file1.txt A A A and file2.txt B B B I would like to have as output: output.txt A B A B A B Can anyone please tell me which may be the simpliest way to do this in batch (I'm forced to use this native windows langage). Thank you! 回答1: If we can assume that the number of lines in both files is equal, this will work: @ECHO OFF TYPE NUL>output.txt SETLOCAL ENABLEDELAYEDEXPANSION SET linecount=0 FOR /F