Is something like this possible in the Windows standard shell using wildcards only?
$ ls -1 003[5,8]0
00350
00380
Is something like this possible in the Windows standard shell using wildcards only?
$ ls -1 003[5,8]0
00350
00380
Not in the standard windows command shell (cmd.exe). It understands only the ? and * wildcards; no regular expressions.
Do you have the option of installing Cygwin, Windows Powershell, or another enhanced shell?
findstr
with the input from a piped dir
command, I'm not sure how to write it, but I think it should be possible. I'm sure @dbenham or @jeb will be able to come up with something :) –
Tricorn dir | findstr /r "003[5,8]0"
will work. –
Adamok yes, you can. Not with a single command, but with a combination of FOR
and IF
. Try this to get you started...
setlocal enabledelayedexpansion
for %%a in (003?0) do (
set fn=%%a
set fnl=!fn:~3,1!
if .!fnl!==.5 (
echo !fn!
)
if .!fnl!==.8 (
echo !fn!
)
)
© 2022 - 2024 — McMap. All rights reserved.