ZTree.com  | ZEN  | About...  

 Index   Back

[OT] Calling for help - batch gurus   [OT]

By: Laurent Duchastel     Montréal, Québec  
Date: Aug 28,2013 at 17:54
In Response to: [OT] Calling for help - batch gurus (Ben Kent)

Hello Ben

Interesting method!

ID are not the same length however, because numbering starts from 1 (there is AlloCine ID "ac1" for instance).

Latest script based on Liviu's original allows also to open two web pages at the same time, notwithstanding where's the ID are in filename, which is a plus.

Nevertheless, I am always impressed how the same challenge can be solved by different means!

Thank you !

>
> Here is another method, without FOR or FIND, should be more resilient
> to special characters. Assumes the ID lengths are constant, if not you
> will need to add extra IF commands.
>
>
> Set _Name="%4"
> Set _ID=%%_Name:~-9,7%%
> if /i "%%_ID:~0,2%%" EQU "ac" goto TypeAC
> Set _ID=%%_Name:~-11,9%%
> if /i "%%_ID:~0,2%%" EQU "tt" goto TypeTT
> ::______________________________________
> :TypeUnknown
> Echo Unknown type
> pause
> goto :eof
> ::______________________________________
> :TypeAC
> start http://www.allocine.fr/film/fichefilm_gen_cfilm=%%_ID:~2%%.html
> goto :eof
> ::______________________________________
> :TypeTT
> start http://www.imdb.com/title/%%_ID%%/
> goto :eof


Laurent Duchastel

1,023 views      
Thread locked
 

Messages in this Thread

 
96,637 Postings in 12,231 Threads, 350 registered users, 88 users online (0 registered, 88 guests)
Index | Admin contact |   Forum Time: Mar 29, 2024 - 12:38 pm UTC  |  Hits:62,405,871  (20,657 Today )
RSS Feed