求个批处理合并txt文件,,, 如何批量合并TXT文件?
\u6279\u5904\u7406\u5408\u5e76\u4e24\u4e2a\u6587\u672c\u6587\u4ef6\u7684\u5185\u5bb9\u6279\u5904\u7406\u5185\u5bb9\u5982\u4e0b\uff0c\u628a\u5b83\u653e\u5728\u548ctxt\u540c\u4e00\u6587\u4ef6\u5939\u4e0b\u9762\u3002
type a.txt>c.txt
echo.>>c.txt
type b.txt>>c.txt
\u6216\u8005\uff1a
more a.txt>c.txt
more b.txt>>c.txt
\u5c06\u6240\u6709\u8981\u5408\u5e76\u7684TXT\u6587\u4ef6\u590d\u5236\u5230\u4e00\u4e2a\u6587\u4ef6\u5939\u4e0b\u9762\uff0c\u63a5\u4e0b\u6765\u6253\u5f00word\uff0c\u65b0\u5efa\u4e00\u4e2a\u7a7a\u767d\u6587\u6863\uff0c\u5355\u51fb\u83dc\u5355"\u63d2\u5165"\u2192"\u6587\u4ef6"\uff0c\u5728\u6253\u5f00\u7684\u7a97\u53e3\u4e2d\u5c06"\u6587\u4ef6\u7c7b\u578b"\u8bbe\u7f6e\u4e3a\u6587\u672c\u6587\u4ef6\uff0c\u6700\u540e\u5c06\u6240\u6709TXT\u6587\u4ef6\u5168\u90e8\u9009\u4e2d\u5e76\u6dfb\u52a0\u8fdb\u6765\u3002
\u4f7f\u7528WORD2003\u4e5f\u53ef\u4ee5.\u6253\u5f00WORD2003,\u70b9\u51fb"\u63d2\u5165"\u2192"\u6587\u4ef6",\u627e\u5230txt\u95ee\u6240\u5728\u76ee\u5f55,\u5168\u9009txt\u6587\u4ef6,"\u786e\u5b9a"\u5373\u53ef.2)\u4e00\u3001\u5148\u5efa\u7acb\u4e00\u4e2a\u6587\u672c\u6587\u6863\uff0c\u628a\u4e0b\u9762\u4e00\u884c\u5185\u5bb9\u590d\u5236\u5230\u91cc\u9762\uff08\u62ec\u53f7\u91cc\u7684\u4e0d\u8981\u590d\u5236\uff09
copy *.txt \u5408\u5e76\u6587\u4ef6.txt(\u201c\u5408\u5e76\u6587\u4ef6\u201d\u662f\u968f\u4fbf\u8d77\u7684\u540d\u5b57\uff09
\u4e8c\u3001\u53e6\u5b58\u4e3a\u6216\u8005\u662f\u4fdd\u5b58\u540e\u6539\u6269\u5c55\u540d\u4e3abat (\u6279\u5904\u7406\u6587\u4ef6\uff09
\u4e09\u3001\u628a\u6b64\u6587\u4ef6\u548c\u9700\u8981\u5408\u5e76\u7684txt\u6587\u4ef6\u653e\u5728\u540c\u4e00\u4e2a\u6587\u4ef6\u5939\u4e2d\uff0c\u53cc\u51fb\u4ed6\u5c31\u53ef\u4ee5\u4e86\u3002
\u770b\u770b\u662f\u4e0d\u662f\u591a\u4e86\u4e00\u4e2a\u5408\u5e76\u597d\u7684\uff1a\u5408\u5e76\u6587\u4ef6.txt
3)\u7528TxtEasy\u8fd9\u4e2a\u8f6f\u4ef6,\u5b83\u53ef\u4ee5\u4e00\u6b21\u5c06\u5f88\u591atxt\u6587\u4ef6\u8fdb\u884c\u5408\u5e76,\u4e5f\u53ef\u4ee5\u4e00\u6b21\u6027\u5c06\u591a\u4e2ahtml\u6587\u4ef6\u8f6c\u6362\u6210txt\u6587\u4ef6,\u8fd8\u53ef\u4ee5\u4e00\u6b21\u6027\u5c06\u591a\u4e2aBIG5\u7801\u7684\u6587\u4ef6\u8f6c\u6362\u6210GB\u7801\u7684\u6587\u4ef6.\u4f7f\u7528\u5f88\u7b80\u5355.
4)WinRAR\u5c31\u53ef\u4ee5\u89e3\u51b3\u95ee\u9898\u3002
Step1\uff1a\u5148\u628a\u8981\u5408\u5e76\u7684TXT\u6587\u4ef6\u6309\u6587\u4ef6\u540d\u6574\u7406\u597d\u653e\u5728\u4e00\u4e2a\u6587\u4ef6\u5939\u4e2d\u5e76\u5168\u90e8\u9009\u4e2d\uff08\u56fe1\uff09\uff0c\u7136\u540e\u5355\u51fb\u9f20\u6807\u53f3\u952e\uff0c\u9009\u62e9"\u6dfb\u52a0\u5230\u6863\u6848\u6587\u4ef6\u2026\u2026"
Step2\uff1a\u5c06\u201c*****.
\uff52ar\u201d\u4fee\u6539\u4e3a\u201c******\uff0etxt\u201d\uff0c\u5e76\u4e14\u5728\u201c\u538b\u7f29\u65b9\u5f0f\u201d\u8fd9\u4e00\u680f\u91cc\u9009\u4e3a\u201c\u5b58\u50a8\u201d\uff0c\u8fd9\u6837\u624d\u53ef\u4ee5\u4fdd\u7559\u539f\u6765\u7684\u6587\u672c\u683c\u5f0f\u3002
Step3\uff1a\u9009\u5b8c\u540e\u70b9\u51fb\u201c\u786e\u5b9a\u201d\uff0c\u9a6c\u4e0a\u5f00\u59cb\u5408\u5e76TXT\u6587\u4ef6\u4e86\u3002
Step4\uff1a\u5c06\u5408\u5e76\u540e\u7684\u6587\u4ef6\u6253\u5f00\uff0c\u5e76\u628a\u6587\u4ef6\u5f00\u59cb\u90e8\u5206\u7684\u4e71\u7801\u53bb\u6389\uff0c\u5408\u5e76\u5c31\u5b8c\u6210\u3002\u8fd9\u79cd\u65b9\u6cd5\u8fd8\u53ef\u4ee5\u5408\u5e76MP3\u3001\u52a8\u753b\u7b49\u6587\u4ef6\u3002
@echo off
cd /d E:\BOOK\
for /d %%i in (*) do (
copy /a %%i\TXT\*.txt %%i.txt
echo %%i
)
pause
删除的话没有必要批处理,直接右键删除TD-女帝奇英传等文件夹即可,生成的合并txt在book下
绛旓細棣栧厛锛屽皢浣犻渶瑕鍚堝苟鐨勬枃鏈枃浠舵寜鐓ч『搴忓懡鍚嶏紝渚嬪锛01.txt銆02.txt銆03.txt 绛夛紝纭繚涓嶈浣跨敤杩炵画鐨勬暟瀛楃紪鍙凤紝鑰屾槸浠ヤ袱浣嶆暟瀛楄〃绀猴紝渚嬪1.txt銆2.txt 涓嶈浣跨敤锛屼互閬垮厤娣锋穯銆傛帴鐫锛屽皢杩欎簺鏂囨湰鏂囦欢鍏ㄩ儴鏀惧叆涓涓叏鏂扮殑銆佺┖鐨勬枃浠跺す涓紝淇濇寔鏂囦欢澶规暣娲併傜劧鍚庯紝鍒涘缓涓涓柊鐨txt鏂囦欢锛鎵撳紑瀹冭繘琛岀紪杈戙傚湪...
绛旓細set "extension=.txt"锛氳缃鍚堝苟鐨鏂囦欢鐨勬墿灞曞悕銆俿et "delimiter= "锛氳缃暟鎹箣闂寸殑鍒嗛殧绗︺俰f exist "%output_file%" del "%output_file%"锛氬鏋滆緭鍑烘枃浠跺凡缁忓瓨鍦紝鍒欏垹闄ゅ畠銆俧or %%i in (*%extension%) do锛氶亶鍘嗘墍鏈夊甫鏈夋寚瀹氭墿灞曞悕鐨勬枃浠躲俧or /f "tokens=* usebackq" %%j in ("%%i")...
绛旓細涓嶇敤浠涔堣蒋浠,涓涓壒澶勭悊灏卞彲浠ヤ簡 type *.txt > a.txt 鎶婁笂闈㈣繖琛岀矘璐村埌涓涓柊寤虹殑txt,鍐嶄繚瀛,鍐嶆妸鏂囦欢鍚嶆敼鎴恆.bat 鍐嶅弻鍑昏繖涓猘.bat灏卞彲浠ヤ簡,瀹冧細鎶婂畠鎵鍦ㄧ殑杩欎釜鏂囦欢澶逛腑鐨勬墍鏈txt鏂囦欢鍚堝苟鍒癮.txt涓
绛旓細鎴戞湁涓鍫嗗皬txt鏂囨湰锛屾兂鏀惧湪鎵嬫満涓婇槄璇伙紝浣嗘槸鍦ㄩ槄璇诲櫒涓垏鎹㈡枃浠舵瘮杈冪儲锛屽氨鍐欎簡涓壒澶勭悊鎶婁粬浠悎骞跺湪涓璧锋垚涓涓txt鏂囦欢銆傜ず渚嬩腑锛氬皢灏忔枃浠跺叏閮ㄦ斁鍦 D:\mini 鏂囦欢澶逛腑锛岀劧鍚庡皢鎵鏈txt鍚堝苟鍒 D:\mini_10k.txt
绛旓細1 灞炴ф硶 鍙抽敭鐐瑰嚮瑕佷繚鎶ょ殑鏂囦欢鎴栨枃浠跺す锛屽乏閿崟鍑诲睘鎬э紝鍦ㄩ殣钘忕瓙鎵撲釜閽╁嵆鍙銆 鐮磋В 杩欑鏂规硶寰堢牬瑙g畝鍗曪紝鍙鍦ㄨ祫婧愮鐞嗗櫒涓緷娆℃墦寮 宸ュ叿--鏂囦欢澶归夐」锛屼箣鍚庡湪鏌ョ湅鏍囩涓夆滄樉绀烘墍鏈夋枃浠跺拰鏂囦欢澶光濈偣鍑荤‘瀹氥傝繖绉嶆柟娉曞浠樺垵绾ц彍楦熷緢鏈夋晥銆 2 winrar鍔犲瘑娉 鍙抽敭鍗曞嚮浣犺鍔犲瘑鐨勬枃浠讹紝閫夆 娣诲姞鍒板帇缂...
绛旓細銆2.txt銆3.txt鍚堝苟鍒000.txt锛屽彲浠ュ湪鍛戒护绐楀彛锛屼娇鐢細锛1锛塩opy 1.txt+0.txt+2.txt+0.txt+3.txt 000.txt 鎴栬 锛2锛夋柊寤轰竴涓寘鍚涓嬪唴瀹圭殑鎵瑰鐞嗘枃浠讹紝骞舵墽琛屻俆YPE 1.TXT>>000.TXT TYPE 0.TXT>>000.TXT TYPE 2.TXT>>000.TXT TYPE 0.TXT>>000.TXT TYPE 3.TXT>>000.TXT ...
绛旓細if exist A鏂囦欢澶\%%i.txt (for /f %%a in ('type %%i') do (set /a v+=1 set/a q=12-v if 12 GTR %q% (set /a q=q+1 echo. >>%%i if 12 GTR %q% (set /a q=q+1 echo. >>%%i ) else exit if 12 GTR %q% (set /a q=q+1 echo. >>%%i ) else exit...
绛旓細xa"==".txt" set "file="%%~a"+!file!"set NowTime=%time:~,8%set NowTime=!NowTime::=!set NowTime=!NowTime: =0!copy /b !file:~,-1! "!NowTime!_NewFile.txt"pause鑴氭湰鏀惧湪褰撳墠鐩綍锛屽嵆鍙妸姝ょ洰褰曚腑鍖呭惈瀛愮洰褰曢噷鐨txt鏂囦欢鍏ㄩ儴鍚堝苟銆傛柊鐨勬枃浠跺懡鍚嶆牸寮忎负鈥滄椂闂確NewFile.txt鈥
绛旓細echo off setlocal enabledelayedexpansion for /f "delims=" %%a in ('dir /b *.txt') do (set a=0 for /f "delims=" %%b in ('type "%%a"') do (set /a a+=1 if !a!==1 (set m=%%b echo Q:!m! >>new.txt))for /f "usebackq skip=1 delims=" %%b in ("%%a")...
绛旓細涓锛歟cho off type 1.txt >new.txt for /l %%i in (2,1,24) do type %%i.txt >>new.txt 鍏堟妸1.txt鍐呭鏀惧叆new.txt 鍒╃敤寰幆鎶2.txt鈥24.txt鍐呭杩藉姞鍏ew.txt 鍏朵腑for鎷彿鍐呯殑鍐呭鎰忎箟涓:浠2寮濮嬪悗闈㈡瘡娆¢掑1.鐩磋嚦澧炲姞鍒24涓烘.妤间富鍙互鏍规嵁瀹為檯鎯呭喌鏇存敼鎷彿涓殑24 绗簩绉嶆柟娉:echo ...