1.

Solve : Hi,, I need to change image sequece file names into one line name?

Answer» <html><body><p>Hi,, I need to fix this problem now. <br/><br/>I am making a batch script. It is about that if users drag and drop the first image file in a folder, the script should read what the last file name is and it will get <a href="https://interviewquestions.tuteehub.com/tag/one-241053" style="font-weight:bold;" target="_blank" title="Click to know more about ONE">ONE</a> sequence file name.<br/><br/>For example, there is a folder with images like "test.0002.jpg", "test.0002.jpg", "test.0002.jpg", "test.0003.jpg", "test.0004.jpg", "test.0005.jpg", "test.0006.jpg", "test.0007.jpg". If I drag the first image, "test.0002.jpg", and I drop it into .bat, it should automatically change like "test.0002-0007.jpg".<br/><br/>When I test my script, it can read first image, but it can't read whole images.<br/><br/>My script is <br/>===========================================================<br/>:convertMOVIE<br/>IF %1 == "" GOTO end<br/>"C:\Program Files (x86)\djv 0.8.2\bin\djv_convert.exe" %1 "%~d1%~p1%~n1.<a href="https://interviewquestions.tuteehub.com/tag/mov-548852" style="font-weight:bold;" target="_blank" title="Click to know more about MOV">MOV</a>" <br/>SHIFT<br/>GOTO convertMOVIE<br/>:end<br/>ECHO.<br/>ECHO Done!<br/>pause<br/>============================================================<br/><br/>"div_convert.exe" is a free software to convert image sequece to quicktime format. <br/>The basic command is like "div_convert.exe test.001-005.jpg test.mov"<br/><br/>Please help me...<br/><br/>Thank you.1. Is the numerical sequence, 0002, 0007, etc, always 4 digits, <br/>2. Is it always at the end of the name part of the filename?<br/>3. Do you mean you want to change just the first filename of the sequence?<br/><br/> Quote</p><blockquote>it can read first image, but it can't read whole images.</blockquote> <br/>I am not sure what you mean by this.<br/>Hi.. Thank you for the response.<br/><br/>1. numerical sequence number is different. sometimes 5 digits, sometimes 3 digits<br/><br/>2. test.0002.jpg, test.0003.jpg, test.0004.jpg, test.0005.jpg.... <br/><br/>3. ex, there are 5 files, like image.0004.jpg, image.0005.jpg, image.0006.jpg, image.0007.jpg, image.0008.jpg<br/>i want to convert these to movie. The converter should reand these sequence files to "image.0004-0008.jpg"<br/>Then it executes as "div_convert.exe image.0004-0008.jpg test.mov" It will make a movie. Quote from: ylthh on October 16, 2010, 01:19:21 PM<blockquote>Hi,, I need to fix this problem now. <br/><br/>I am making a batch script. It is about that if users drag and drop the first image file in a folder, the script should read what the last file name is and it will get one sequence file name.<br/><br/>For example, there is a folder with images like "test.0002.jpg", "test.0003.jpg", "test.0004.jpg", "test.0005.jpg", "test.0006.jpg", "test.0007.jpg". If I drag the first image, "test.0002.jpg", and I drop it into .bat, it should automatically change like "test.0002-0007.jpg".<br/><br/>When I test my script, it can read first image, but it can't read whole images.<br/><br/>My script is <br/>===========================================================<br/>:convertMOVIE<br/>IF %1 == "" GOTO end<br/>"C:\Program Files (x86)\djv 0.8.2\bin\djv_convert.exe" %1 "%~d1%~p1%~n1.mov" <br/>SHIFT<br/>GOTO convertMOVIE<br/>:end<br/>ECHO.<br/>ECHO Done!<br/>pause<br/>============================================================<br/><br/>"div_convert.exe" is a free software to convert image sequece to quicktime format. <br/>The basic command is like "div_convert.exe test.001-005.jpg test.mov"<br/><br/>Please help me...<br/><br/>Thank you.<br/></blockquote> So you just rename the first file?<br/><br/>Why have you <a href="https://interviewquestions.tuteehub.com/tag/quoted-2236199" style="font-weight:bold;" target="_blank" title="Click to know more about QUOTED">QUOTED</a> yourself?<br/><br/>correct, rename the first file.is filename format always something dot NNNN dot jpg like this: abcd.0001.jpg? (always three parts separated by dots?)<br/><br/><br/>yes Code: <a>[Select]</a>echo off<br/>set fullname=%~1<br/>set foldernm=%~dp1<br/>set barename=%~nx1<br/>cd /d "%foldernm%"<br/>for /f "tokens=1-3 delims=." %%A in ("%barename%") do (<br/> set fileroot=%%A<br/> set firstnum=%%B<br/> set fileextn=%%C<br/> )<br/>set filespec=%fileroot%.*.%fileextn%<br/>for /f "tokens=1-3 delims=." %%A in ('dir /b "%filespec%"') do set lastnum=%%B<br/>set param1=%fileroot%.%firstnum%-%lastnum%.%fileextn%<br/>set param2=%fileroot%.mov<br/>"C:\Program Files (x86)\djv 0.8.2\bin\djv_convert.exe" "%param1%" "%param2%" <br/>pause<br/><br/>Hi, Salmon<br/><br/>Thank you so much for your help.<br/><br/>In network server, "dir /b" didn't work well. The file order is not alphabetical. Then I added dir /b /o, then it worked.<br/>Is it correct? Then when I execute batch file, it worked. <br/><br/>Thank you so much again. Quote from: ylthh on October 17, 2010, 09:02:10 AM<blockquote>In network server, "dir /b" didn't work well. The file order is not alphabetical. Then I added dir /b /o, then it worked.<br/>Is it correct?</blockquote> <br/>That sounds good to me.<br/><br/></body></html>


Discussion

No Comment Found