NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Add-ons (3rd party plugins, utilities and skins) Old Stuff (Legacy) GB-PVR Support (legacy) v
« Previous 1 … 94 95 96 97 98 … 1231 Next »
Extracting new filename from WizRenameRecording log

 
  • 0 Vote(s) - 0 Average
Extracting new filename from WizRenameRecording log
gEd
Offline

Posting Freak

London
Posts: 3,518
Threads: 100
Joined: Jan 2005
#1
2009-09-15, 07:01 PM
I found the following script (extract) on the forum,

REM last line in logfile is the new filename
For /F "tokens=*" %%i IN (.\logs\WizRenameRecording.log) DO set newName=%%i

However, the last line of the log doesn;t / no longer has the new file name.

Can a clever scripting bunny show me how I can do this (Piece of cake in *nix but my wiindows scripting skills are not good enough).

The line with the new file name is

Result : BBC News at Six

cheers!


==========================================================
WizRenameRecording - Rename recording filenames
Run on: 15/09/2009 18:36 (v0.1.0.3)
==========================================================
Parameters:
[0]: R:\Recordings\BBC News at Six\BBC News at Six_20090915_18001830.ts
[1]: ({episode}{or}{show})
Retrieving entry from Recordings table...
Evalute called.
Source : BBC News at Six
Pattern: ({episode}{or}{show})
Result : BBC News at Six
Rename called.
Source : R:\Recordings\BBC News at Six\BBC News at Six_20090915_18001830.ts
Target : R:\Recordings\BBC News at Six\BBC News at Six.ts
Step1: Rename file- Successful.
Step2: Comskip/support files- 3 comskip/support files renamed.
Step3: Rename thumbnails- 0 thumbnails renamed.
Step4: Update recording table- Successful.
Complete: 15/09/2009 18:36
Return code: 0
==========================================================
“If this is the way Queen Victoria treats her prisoners, she doesn't deserve to have any.”
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#2
2009-09-18, 05:37 AM
Well, I could fix WizRenameRecording to once again print result at end of file (which I will next time I'm in the code), or....

If you install Win 2003 Server Resource Kit from Microsoft, you will find several batch tools that will help.

In particular there is a program called qgrep, that is like the unix grep comamnd.

You could put the command:

qgrep -e "Target :" WizRenameRecording.log > temp.txt
or use "Result :" for the search string if you like...

Then perform the for script you noted (against the temp.txt file) to pull out the last filename.

To remove the Result : or Target : eyecatcher,

change the
set newName=%%i
to
set newName=%%i:~9

To set newName from postion 10 thru end of line effectively removing the eyeCatcher...

For example:
Code:
REM last line in logfile is the new filename
qgrep -e "Target :" .\logs\WizRenameRecording.log > temp.txt
For /F "tokens=*" %%i IN (temp.txt) DO set tempName=%%i
set newName=%tempName:~9%

You may have to play around with above scripting as I have not tested it but it should work (or be pretty close).
gEd
Offline

Posting Freak

London
Posts: 3,518
Threads: 100
Joined: Jan 2005
#3
2009-09-18, 03:59 PM
many thanks JW.

Instead of exporting name at end of log perhaps you could have a -x [filename] option that exports newname to [filename]

Just a small thought.

I will play with qgrep, I'm sure it will work fine.

cheers!
“If this is the way Queen Victoria treats her prisoners, she doesn't deserve to have any.”
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  tweaking the recording filename format jrousell 7 2,836 2010-03-06, 04:58 PM
Last Post: snewpy
  put season/episode information in filename dbldown768 14 4,035 2009-03-20, 11:01 PM
Last Post: dbldown768
  dvr-ms mux filename mikeh49 2 1,457 2009-02-24, 05:11 PM
Last Post: mikeh49
  Multi-record - extracting to separate mpegs garyeuph 4 1,620 2008-11-21, 09:35 AM
Last Post: garyeuph
  "-import:filename" ? pBS 5 2,230 2008-09-27, 04:25 AM
Last Post: sub
  PostProcessing [Filename] [Channel Number] Smoker 24 5,257 2007-04-20, 12:30 AM
Last Post: Smoker
  Filename template for recordings? joche 5 1,875 2005-02-15, 11:17 PM
Last Post: Guest
  best s/w for extracting snippets out of a show to archieve (e.g. video clip)??? 0 238 Less than 1 minute ago
Last Post:

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode