[英]How to merge files horizontally in Windows 7 command prompt?
I have three files in a directory 我的目录中有三个文件
File 1: 文件1:
a b
c d
File 2: 档案2:
1 2
3 4
File 3: 文件3:
e f
g h
I know that in windows command prompt, when I type "copy * new.txt", I get a file called new.txt which looks like the following. 我知道在Windows命令提示符下,当我键入“ copy * new.txt”时,我得到一个名为new.txt的文件,如下所示。
a b
c d
1 2
3 4
e f
g h
In command prompt, how would I combine the files horizontally, so I get the following for my combined file? 在命令提示符下,我将如何水平合并这些文件,以便对合并后的文件进行以下操作?
a b 1 2 e f
c d 3 4 g h
@echo off
setlocal EnableDelayedExpansion
3< File2.txt 4< File3.txt (
for /F "delims=" %%a in (File1.txt) do (
set "line1=%%a"
set /P "line2=" <&3
set /P "line3=" <&4
echo !line1! !line2! !line3!
)
)
Further details at this site . 该站点的更多详细信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.