作者hsiaulong (假性眯眯眼)
看板Windows
标题Re: [问题] 想用批次档整理记事本
时间Sat Jul 6 09:49:26 2013
※ 引述《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
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 123.193.196.148
1F:推 ed78617 :thank you啦 07/08 02:28