Batch - extracting names from file to draw
Posted: 2011-03-29T09:53:31-07:00
I would like to solve this thema:
I have for example
.jpg files (1.jpg - n.jpg)
and
list.txt written as follows:
1¦name_1
2¦name_2
....
n¦name_n
I want to draw names from this list.txt file to single pictures (1.jpg annotate with name_1 and so on).
I tried to use this batch, but it reads just last name:
-------------------------------------------------------------
set %sc=0
for %%f in (*.jpg) do (
set /a %sc=sc+1
)
set %lv=0
:begin
set /a %lv=lv+1
for /f "delims=¦ tokens=2 skip=%lv%" %%A in (list.txt) do (convert -fill yellow -pointsize 20 -gravity south -draw "text 0,4 '%%A' " %lv%.jpg c%lv%.jpg)
if %lv% equ %sc% goto enddir
goto begin
:enddir
-------------------------------------------------------------
Can You help me?
Thanx
Michal
I have for example
.jpg files (1.jpg - n.jpg)
and
list.txt written as follows:
1¦name_1
2¦name_2
....
n¦name_n
I want to draw names from this list.txt file to single pictures (1.jpg annotate with name_1 and so on).
I tried to use this batch, but it reads just last name:
-------------------------------------------------------------
set %sc=0
for %%f in (*.jpg) do (
set /a %sc=sc+1
)
set %lv=0
:begin
set /a %lv=lv+1
for /f "delims=¦ tokens=2 skip=%lv%" %%A in (list.txt) do (convert -fill yellow -pointsize 20 -gravity south -draw "text 0,4 '%%A' " %lv%.jpg c%lv%.jpg)
if %lv% equ %sc% goto enddir
goto begin
:enddir
-------------------------------------------------------------
Can You help me?
Thanx
Michal