想用批次檔整理記事本 - Windows

By Odelette
at 2013-07-06T09:49
at 2013-07-06T09:49
Table of Contents
※ 引述《ed78617 (雞爪)》之銘言:
: 小弟現有70本記事本,置於同一資料夾中,依檔名中的數字大小排列如下:
: position_d=181.txt
: position_d=182.txt
: .
: .
: .
: position_d=250.txt
: 現欲將各記事本的內容,匯集至新事本list.txt。
: 於是試了以下指令
: @echo off
: for /L %n in (181,1,250) do type position_d=%n.txt >> list.txt
: pause
: 及
: @echo off
: for %%i in (*.txt) do type %%i >> list.txt
: pause
: 但都沒有成功,懷疑問題是出在等號的表達,因為第二個寫法出現以下錯誤訊息:
: The system cannot find the file specified.
: Error occurred while processing: position_d.
: The system cannot find the file specified.
: Error occurred while processing: 250.txt.
: 小弟還是新手,懇請版友們幫幫忙
應該就是檔名部份的問題
你可以改成這樣
@echo off
for /L %%n in (181,1,250) do type "position_d=%%n.txt" >> list.txt
pause
或是
@echo off
for %%i in (*.txt) do type "%%i" >> list.txt
pause
--
: 小弟現有70本記事本,置於同一資料夾中,依檔名中的數字大小排列如下:
: position_d=181.txt
: position_d=182.txt
: .
: .
: .
: position_d=250.txt
: 現欲將各記事本的內容,匯集至新事本list.txt。
: 於是試了以下指令
: @echo off
: for /L %n in (181,1,250) do type position_d=%n.txt >> list.txt
: pause
: 及
: @echo off
: for %%i in (*.txt) do type %%i >> list.txt
: pause
: 但都沒有成功,懷疑問題是出在等號的表達,因為第二個寫法出現以下錯誤訊息:
: The system cannot find the file specified.
: Error occurred while processing: position_d.
: The system cannot find the file specified.
: Error occurred while processing: 250.txt.
: 小弟還是新手,懇請版友們幫幫忙
應該就是檔名部份的問題
你可以改成這樣
@echo off
for /L %%n in (181,1,250) do type "position_d=%%n.txt" >> list.txt
pause
或是
@echo off
for %%i in (*.txt) do type "%%i" >> list.txt
pause
--
Tags:
Windows
All Comments

By Ursula
at 2013-07-07T21:56
at 2013-07-07T21:56
Related Posts
關於 coreldraw win7開啟選擇同名檔案

By Anthony
at 2013-07-06T01:27
at 2013-07-06T01:27
有關IIS轉移問題請教

By Ula
at 2013-07-05T03:03
at 2013-07-05T03:03
windows 7 家用版無法自動指派磁碟機代號

By Zenobia
at 2013-07-04T21:59
at 2013-07-04T21:59
windows 7 家用版無法自動指派磁碟機代號

By Annie
at 2013-07-04T16:33
at 2013-07-04T16:33
win7更新問題

By Thomas
at 2013-07-04T14:09
at 2013-07-04T14:09