Aacini
Content Type
Profiles
Forums
Events
Posts posted by Aacini
-
-
Hi. I am newbie at this forum. I was invited here by DosCode to post my last solution to this problem that was developed in detail in other site. So here it is:
@echo off
setlocal EnableDelayedExpansion
set "source=GEN 0 GENERAL.html"
set "pdf=0_1_en.pdf"
echo In file: "%source%"
echo Look for anchor: "%pdf%"
for /F "delims=" %%c in ('findstr /C:"<a " "%source%" ^| findstr /C:"%pdf%"') do (
set "tag=%%c"
rem Get the value of "<b>" sub-tag
set "tag=!tag:<b>=$!"
set "tag=!tag:</b>=$!"
for /F "tokens=2 delims=$" %%b in ("!tag!") do set title=%%b
echo Title found: "!title!"
)If you wish, you may review the development of this solution at this site
Regards...
Antonio
EDIT: I fixed a detail in my code (changed "<a>" by "<a ") that prevent it to correctly run...
0
renaming files in CMD scripts
in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Posted
Hi. The big problem with my code is that in this line:
the start of tag must be "<a " instead of "<a>", as Yzöwl noted:
I had fixed this problem in my original post above.
As I said in the original site, I don't know much about .PDF files and this detail was confused because the tag <a> was mentioned there. However, I noted this point when I indicated that I tested this program with this "GEN 0 GENERAL.html" example file:
I apologize for any trouble caused by this detail...