标题: 怎么样去掉扩展名
[打印本页]
作者: knight1006
时间: 2009-5-11 12:03
标题: 怎么样去掉扩展名
我这里有一个字条串如:
路径\abc 2009.05.12 hga.txt
其扩展名不确定是什么,不一定是txt,也可能是rar或zip等等
请问要怎么识别出来扩展名并把它去掉
作者: ccwan
时间: 2009-5-11 21:00
看看for的帮助。
假设有a.txt,内容为:
路径\abc 2009.05.12 hga.txt
路径\abc 2009.05.12 tys.rar
路径\abc 2009.05.12 mni.exe
用代码:for /f "delims=" %%i in (a.txt) do echo %%~ni
[
Last edited by ccwan on 2009-5-11 at 21:02 ]
作者: knight1006
时间: 2009-5-11 22:52
谢谢楼上!