0

I have several VOB-files on a DVD.
The command

(for %i in (D:\VIDEO_TS\*.VOB) do @echo file '%i') > filelist.txt

in the Windows cmd command line returns filelist.txt with
file 'D:\VIDEO_TS\VIDEO_TS.VOB' file 'D:\VIDEO_TS\VTS_01_0.VOB' file 'D:\VIDEO_TS\VTS_01_1.VOB' file 'D:\VIDEO_TS\VTS_01_2.VOB' file 'D:\VIDEO_TS\VTS_01_3.VOB' file 'D:\VIDEO_TS\VTS_01_4.VOB' file 'D:\VIDEO_TS\VTS_02_1.VOB'

inside. These are exactly the VOB-files located in D:\Video_TS.

Question: How do I have to change the command syntax if I only want the files highlighted here in the list, that is only those with the endings 01_1, 01_2, 01_3, 01_4?

That means that filelist.txt is only

file 'D:\VIDEO_TS\VTS_01_1.VOB' file 'D:\VIDEO_TS\VTS_01_2.VOB' file 'D:\VIDEO_TS\VTS_01_3.VOB' file 'D:\VIDEO_TS\VTS_01_4.VOB'

at the end.

PS: I tried command from that link https://ss64.com/nt/for.html but I don't get the correct one. I'm not familiar with the cmd syntax.

8
  • What do you mean? 01_1 ... 01_4 are not extensions first of all. Secondly, what is your exact requirement? Anything that has format of 01_1 at the end of non-extension part of file name, higher than 01_0 and smaller than 02_0? And lastly, what did you try?
    – Destroy666
    Commented Mar 15, 2023 at 16:04
  • See €dit. ;) ......
    – cis
    Commented Mar 15, 2023 at 16:08
  • You still did not clarify how your requirements are related to the files that happen to match your pattern. Based on the incomplete specification, the following command produces the expected output without checking any files: (for /L %i in (1,1,4) do @echo file 'D:\VIDEO_TS\VTS_01_%i.VOB') > filelist.txt
    – Bodo
    Commented Mar 15, 2023 at 16:20
  • I edited something else. Next I should probably explain why I want to do this. Actually, I'm just interested in how I can do that. But the above command works. Thanks.
    – cis
    Commented Mar 15, 2023 at 16:25
  • My command does not check what files exist, it simply prints fixed names with numbers from 1 to 4. You did not specify what you want to get if the DVD has more or less VTS_01_*.VOB files, e.g. 1..3 only or 1..5. See the first comment.
    – Bodo
    Commented Mar 15, 2023 at 16:29

0

You must log in to answer this question.

Browse other questions tagged .