Board logo

标题: [文件操作] 批处理实现文件扩展名是依次显示的问题 [打印本页]

作者: netdzb    时间: 2021-2-5 19:43     标题: 批处理实现文件扩展名是依次显示的问题

文件扩展名是一次显示的问题

扩展名存在2段,001-999,然后是1000-9999
如何依次显示出来,这个只有分成2段写吗?
  1. @echo off
  2. for /f "delims=" %%a in ('dir /s/b/a-d "*.0*";*.1???') do echo %%a
  3. pause
复制代码
我这个代码4位数字会被插入3位数字,请教如何修改?

D:\ceshi\good\good.flac.1560
D:\ceshi\good\good.flac.1561
D:\ceshi\good\good.flac.1562
D:\ceshi\good\good.flac.1563
D:\ceshi\good\good.flac.1564
D:\ceshi\good\good.flac.1565
D:\ceshi\good\good.flac.1566
D:\ceshi\good\good.flac.1567
D:\ceshi\good\good.flac.1568
D:\ceshi\good\good.flac.1569
D:\ceshi\good\good.flac.157
D:\ceshi\good\good.flac.1570
D:\ceshi\good\good.flac.1571
D:\ceshi\good\good.flac.1572
D:\ceshi\good\good.flac.1573
作者: Batcher    时间: 2021-2-6 20:31

回复 1# netdzb
  1. dir /b /s /a-d *.flac.* | findstr "\.[0-9][0-9][0-9][0-9]$"
复制代码





欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2