我曾尝试使用以下命令拆分文件Mac:
split -b 20mb myFile.zip
然后我得到了一些以x: xaa xab开头的文件
我可以使用cat
终端命令cat xaa xab > myFile.zip
恢复Mac上的文件。
但它无法在Windows上执行cat
命令...:-(有没有可行的解决方案?
在进阶时谢谢
伊沙伊
发布于 2017-07-24 15:53:50
下面的批处理脚本将执行您需要的操作。通过batchfile.bat x myFile.zip
使用它,它循环遍历以指定前缀x
开头的所有文件,并使用type
将它们追加到结果文件myFile.zip
@echo off
set INVARGS=0
if [%1] == [] set INVARGS=1
if [%2] == [] set INVARGS=1
if %INVARGS% == 1 (
echo Usage: %0 ^<file_prefix^> ^<result_file^>
goto eof
)
set "prefix=%~1"
set "resFile=%~2"
rem create new empty file in directory of batch file: %~dp0
break>"%resFile%"
rem loop through all output line of the dir command, unset delimns
rem so that space will not separate
for /F "delims=" %%a in ('dir "%prefix%*" /b /s /a-d') do (
rem don't use the result file
if not [%%a] == [%resFile%] (
rem append the output to file
type "%%a">>"%resFile%"
)
)
:eof
https://stackoverflow.com/questions/45274516
复制相似问题