jaclaz, on 21 February 2012 - 10:46 AM, said:
@echo off
setlocal EnableDelayedExpansion
set "source=GEN 0 GENERAL.html"
echo In file:%source%
FOR /F "tokens=* delims=" %%A IN ('FIND ".pdf" "%source%" ^|FIND "href"^|FIND "class="') DO (
This is a sub-function. This tells me that you did not set %pdf% file to search for (in the html file). What do you try to do in the loop? Do you try to find all pfds that are in html document? Because what I tried to do was to find one certain pdf, that is in the html document. You can start either by searching pdfs, so you should set the name of pdf file. This instructs where the anchor and title is placed.
But as a complete code, that should find all pdfs and for each pdf to open the html document which is associated with the pdf. So if your code as sub-function should work fine, you must define pdf file you look for.
Late answer to bphlpt.
bphlpt, on 21 February 2012 - 11:24 AM, said:
DosCode - No offense was meant, and I'm a CMD script fan.
„There are definitely cases, IMO, where CMD script is faster and more flexible than other options. “
That is not the reason why I’m interested in CMD. It is much simpler to me against VBS. VBS is Object orientated language and so is more harder to learn. CMD with connection with gnuwin results in something what seems to me similar to bash. So that is the reason for been it favourite for me.
„CoffeeFiend and I don't need to continue on. “
I have finished so I also need not to continue.
„Our two posts do not distract from your overall goal as much as your posts which have been scattered over multiple threads and have yet to come up with a working solution. “
So to you. You have seen I was distracted enough to overlooked two post. I explained that before.
„You have been asking about bits and pieces for a week now, and we didn't even know what your overall goal was until 18 hours ago. “
If I would told you what was my overall goal, than I would spent a lot of time with long time explaining and I would not get answers to my original questions which were the individual solutions of certain situations. I did not want you just all solved instead me. The second point is that is was simpler to me just to make what I want by myself, and then to paste the code and wait your reactions. This is just the way of demonstration. That's better then lots of words. Since the start I see I have learned something, I moved from nothing to something. And that’s what I personally feel to be satisfying. Also I see no reason why I should spend 24 hours 7 days week on forum, I don't mind this took more then week. So maybe you had wait, but I see no problem in it.
Late answer to Aacini's code
Aacini, on 22 February 2012 - 02:14 AM, said:
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:
Yes, works but there should be some condition, because it returns title "" and twice title ,,GEN 0.1 Preface", but you need not to do it, because I have already my code completed, so as you could see in the debuger's code version.
Replay to Yzöwl's CMD code
Yzöwl, on 22 February 2012 - 05:35 PM, said:
If that's all you want to do, here's a quick untested script.
This script prints
REN "gen_0_3.pdf" "GEN 0.3 Record of AIP Supplements.pdf"
REN "gen_2_1.pdf" "GEN 2.1 Measuring System, Aircraft Markings, Holidays.pdf"
REN "gen_4_1.pdf" "GEN 4.1 Charges for Aerodromes and Heliports.pdf"
REN "gen_4_2.pdf" "GEN 4.2 Charges for Air Navigation Services.pdf"
Press any key to continue...
So pdfs staring by digit are not listed.
Replay to CoffeeFiend
CoffeeFiend, on 22 February 2012 - 08:50 PM, said:
gc *.htm|?{$_ -match [regex]'".*/(.*pdf)".*?b>(.*?)<'}|%{ren $matches[1] ($matches[2]+".pdf")}
I cursorily searched internet for gnuwin PowerShell binaries but did not find so did not test your code.
This post has been edited by DosCode: 24 February 2012 - 09:38 AM