Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: name prefix mindblowing problem  (Read 2460 times)

0 Members and 1 Guest are viewing this topic.

PeZiK

  • Guest
name prefix mindblowing problem
« on: March 23, 2006, 10:05:30 AM »
I have got an image sequence that I need convert to another format. It's very
important that I keep the original name prefix and the first sequental number.

The script is suppose to work like this : I drag 'n drop a folder containing a sequence.
It reads the content and generates a playlist file. Then a render program uses this
playlist file to identify the order of the sequence and the format.

Then it converts it to another format with the same name prefix and start frame.

example of playlist:

201_02_C1_01_01_0000333.tif
201_02_C1_01_01_0000334.tif
201_02_C1_01_01_0000335.tif
201_02_C1_01_01_0000336.tif
201_02_C1_01_01_0000337.tif
201_02_C1_01_01_0000338.tif
201_02_C1_01_01_0000339.tif
201_02_C1_01_01_0000340.tif
201_02_C1_01_01_0000341.tif
201_02_C1_01_01_0000342.tif


Code: [Select]
@echo off


--create sequence playlist (this I was able to do :))

dir %1\*.tif /b /o > %1\playlist.txt


--autmatically get sequence name prefix code ??? - help

    201_02_C1_01_01 = %prefix%

--autmatically get sequence first sequential number code (which is 0000333) ??? - help

    0000333 = %number%

c:\render\custom_convert_render.exe %1\playlist.txt c:\test\%prefix%_%number%.dpx

exit


The custom convert render works like this :

[.exe] [playlist] [new fileformat]


I hope you can understand this, can you help me out to fill in the huge gaps ? 8-)

PeZiK
« Last Edit: March 23, 2006, 10:13:33 AM by PeZiK »

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: name prefix mindblowing problem
« Reply #1 on: March 24, 2006, 04:37:46 AM »
I'm not sure I understand. Does not %prefix%_%number% resolve back to the original file name without the extension? In any case you can use the FOR statement to rip apart the file name and rearrange it as you like.

Code: [Select]
for /f "tokens=1-2 delims=." %%i in (dir %1\*.tif /b /o) do (
      c:\render\custom_convert_render.exe %1\playlist.txt c:\test\%%i.dpx
      )

You can rip the file name apart further by adding _ as a delimiter:

Code: [Select]
for /f "tokens=1-7 delims=_." %%i in (dir %1\*.tif /b /o) do (
c:\render\custom_convert_render.exe %1\playlist.txt c:\test\%%i_%%j_%%k_%%l_%%m_%%n.dpx
      )

prefix = %%i_%%j_%%k_%%l_%%m
number = %%n

Hope this helps.  8-)
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

PeZiK

  • Guest
Re: name prefix mindblowing problem
« Reply #2 on: March 24, 2006, 06:59:14 AM »
Thank you very much for your help. You are spot on what I'm actually asking for  ;)


I tried it and it didn't work. I'm really bad at this but here's what I did with your code :

Code: [Select]
@echo off

for /f "tokens=1-2 delims=." %%i in (dir %1\*.tif /b /o > %1\playlist.ifl) do (
      C:\DPX_UTILS\FC\bin\SpeedGradeRender.exe %1\playlist.ifl c:\temp\%%i.dpx
      )

pause

del 1%\playlist.ifl


PeZiK

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: name prefix mindblowing problem
« Reply #3 on: March 24, 2006, 07:45:01 AM »
You don't need the DIR command to output to a file:

Code: [Select]
@echo off
for /f "tokens=1-2 delims=." %%i in (dir %1\*.tif /b /o) do (
      c:\render\custom_convert_render.exe %1\%%i.%%j c:\test\%%i.dpx
      )
pause

Hope this works.  ;)

The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein