我需要在Windows上使用
*.bat
脚本加入两个二进制文件。
我怎么能实现?
type
命令与unix相似。
示例1:cat
等于:
type file1 file2 > file3
示例2:
cat file1 file2 > file3
该命令将将所有VCARD合并为一个。
您可以使用
type *.vcf > all_in_one.vcf
这样:
如果您可以控制工作的机器,我强烈建议您安装Gnuwin32
。只需“下载全部”,然后让WGET程序检索所有软件包。然后,您将可以访问猫,grep,查找,gzip,tar,更少和数百个。GNUWIN32是我在新Windows Box上安装的第一件事。
type
仅使用多个源文件和一个目标文件使用DOS复制命令。
type file1,file2
您可能需要二进制文件的 /b选项如果我上大学时存在这样的事情,我认为我可以在本机Windows bash shell中完成大多数Unix编程任务。
如果您只想将文本附加到现有文件的末尾,则可以使用>>管道。例如:
copy file1+file2 appendedfile
因此,我正在寻找一种类似的解决方案,以保留EOL炭,发现没有办法 这是Windows的本机猫-Https://mega.nz/#!6avgwqhl!qj1sxx -tltpbkpiux__iqdgkaifmb21ghlferhnoawk
我称其为尖锐的猫,因为它使用c#构建,可以随意使用防病毒软件和源代码扫描。
我尝试重新加入已拆分在Linux服务器中的TAR存档。Usage: cat file1 file2 file3 file4 -o output.txt
-o | Specifies the next arg is the output, we must use this rather than ">>" to preserve the line endings
中使用type
,它将导致文件以错误的顺序加入。
https://github.com/sharkdp/bat中找到了一个名为
cmd.exe
1>2# : ^
'''
@echo off
python "%~nx0" " %~nx1" "%~nx2" "%~nx3"
exit /b
rem ^
'''
import sys
import os
sys.argv = [argv.strip() for argv in sys.argv]
if len(sys.argv) != 4:
sys.exit(1)
_, file_one, file_two, out_file = sys.argv
for file_name in [file_one, file_two]:
if not os.path.isfile(file_name):
print "Can't find: {0}".format(file_name)
sys.exit(1)
if os.path.isfile(out_file):
print "Output file exists and will be overwritten"
with open(out_file, "wb") as out:
with open(file_one, "rb") as f1:
out.write(f1.read())
with open(file_two, "rb") as f2:
out.write(f2.read())
join.bat file_one.bin file_two.bin out_file.bin