Log in

View Full Version : CLI question: is there something akin to "-BF[filelist] -OF[filelist]"?


Chainmax
9th December 2008, 03:22
I am currently trying to make a DVD out of multiple short clips taken by a video camera. Following the DGIndex manual, I created a filelist and then used -BF[filelist] -OF[d2vname]. Now, this created a single d2v with a single sound file.
While this is ok for this particular project, I might sometimes need that the output be named exactly like the input files, i.e vid001.MOD,vid002.MOD,.......,vid120.MOD --> vid001.d2v,vid002.d2v,.......,vid120.d2v (plus their associated sound files). I tried to find some information on whether this is possible or not but was not able to find anything. Any feedback on this matter will be greatly appreciated.

RunningSkittle
9th December 2008, 17:59
So you want to do something like this? :
vid001.mod->vid001.d2v
vid002.mod->vid002.d2v
...
vid00n.mod->vid00n.d2v

J_Darnley
9th December 2008, 21:53
FOR %A IN (*.mod) DO dgindex.exe -IF[%~A] -OF[%~nA] -EXIT

Chainmax
10th December 2008, 23:32
RunningSkittle: exactly, that's what I will need sometimes.

J_Darnley: that would go inside a .BAT file, right? One thing, though: I need the MOD files to be picked up by descending modified date (which is why I use a filelist). How should your suggestion be modified in order to reflect that?

RunningSkittle
11th December 2008, 16:15
@echo off
cd c:\test
for /f "usebackq" %%a in (`"dir /b /s /os | find ".mod""`) do (echo c:\test\dgindex.exe -IF[%%a] -OF[%%~na] -EXIT)
pause


Copy and paste that into a batch file, rename the directories to what ever you want. Test with the echo command, if everything looks good, delete the echo. The piping of the directory output to the find command lets you specify what file type you want to index. The switch /os tells the directory command to order by creation time. If you want the files to be done in the reverse order, use the command switch /o-s. You can choose to sort with creation, last access, or last written time fields with the switch /t

(`"dir /b /s /os | find ".mod""`) //important line to play around with... use "dir /?" for more switchs and information (particularly the switch /t )


With a directory with files named:

vid001.mod
...
vid00n.mod
test.txt //for testing the pipe to find command


my console output looks like this:

c:\test\dgindex.exe -IF[c:\test\vid001.mod] -OF[vid001] -EXIT
c:\test\dgindex.exe -IF[c:\test\vid002.mod] -OF[vid002] -EXIT
c:\test\dgindex.exe -IF[c:\test\vid003.mod] -OF[vid003] -EXIT
c:\test\dgindex.exe -IF[c:\test\vid00n.mod] -OF[vid00n] -EXIT


Or if you want to use the filelist, change the for loop to this:
for /f %%a in (filelist.txt) do (echo c:\test\dgindex.exe -IF[%%a] -OF[%%~na] -EXIT)

Chainmax
12th December 2008, 05:48
Thank so much for your help, I really appreciate it http://smilies.vidahost.com/otn/wink/thumb.gif.

J_Darnley
13th December 2008, 12:53
@echo off
cd c:\test
for /f "usebackq" %%a in (`"dir /b /s /os | find ".mod""`) do (echo c:\test\dgindex.exe -IF[%%a] -OF[%%~na] -EXIT)
pause


That would be much simpler to use (with an extra % if in a a batch file):
FOR /F %A IN ('DIR /B /OD /TC *.mod') DO dgindex -IF[%A] -OF[%~nA] -EXIT

/Ttimefield Controls which time field displayed or used for sorting
C Creation
A Last Access
W Last Written

RunningSkittle
13th December 2008, 15:40
whoops i forgot dir could specify strings...
Although you still need to use "usebackq" to specify that its a command and not string.

Chainmax
18th December 2008, 22:17
I put all MOD files, along with DGIndex and the .BAT file in a folder called C:\Video. The content of the .BAT file is this:

for /f "usebackq" %%a in (`dir /b /OD /TW *.mod`) do dgindex.exe -IF[%%a] -OF[%%~na] -EXIT

Upon executing the batch file, a cmd window and a DGIndex window pop up. The former shows the batch file command (with only one % each time instead of two) and the first DGIndex command.
The DGIndex window, however, remains static (no d2v seems to be being created). If I quit DGIndex, the second command activates and a new window appears which also remains static. What am I missing?

RunningSkittle
18th December 2008, 22:55
Thats because the dgindex parameters were not correct, sorry i was being lazy and assumed you had the CLI parameters picked out.


for /f "usebackq" %%a in (`dir /b /OD /TW *.mod`) do dgindex.exe -IF=[%%a] -OF=[%%~na] -EXIT


That should work for what you need. Read the DGindex manual and make sure you input the parameters you want. You can call dgindex from another folder as well.

Chainmax
19th December 2008, 06:35
As stated in the OP, I already had used the filelist to create a single d2v. I can't believe I left out the = signs :o. Thanks for reminding me of that.