Forum Index  ViceVersa HOME         FAQ and Knowledge Base

 FAQForum FAQ   SearchSearch Forum  RegisterRegister 
 ProfileProfile   Log inLog in 

New variable needed for ALL copied files.

 
Post new topic   Reply to topic     Forum Index -> Wish List
Author Message
Wollrabe



Joined: 26 Aug 2010
Posts: 35

PostPosted: Wed Sep 08, 2010 3:46 pm    Post subject: New variable needed for ALL copied files. Reply with quote

Thanks, guess another one for the Wish list! It would be nice to have a variable that collects only the Target path for each file copied. But more then 10 copied files, ALL files copied. like VV_ALL_COPIED_FILES. Even better would be to just capture the file, and not the entire path. I am feeding a HTML form with a list of all files copied, but the VV_COPIED_FILES variable only holds 10 copied items, and it contains the Source and Target paths, with other text as well.
Back to top
Wollrabe



Joined: 26 Aug 2010
Posts: 35

PostPosted: Tue Sep 28, 2010 11:13 pm    Post subject: Wrote a VBScript that parses the log file... Reply with quote

I was able to write a VBScript that parses out the log file. It captures each individual file name that was copied, where it came from, where it was copied to, and in my case where it was versioned to. With no duplicate paths listed. The output is sent to a HTML form. One script fires off the Tortoise SVN Commit screens, once the Commit is done, It fires off the parsing script which fills out the HTML form. Once that is displayed, it prompts you to Delete the files from it's Source location.
Back to top
TGRMN Software
Site Admin


Joined: 10 Jan 2005
Posts: 8467

PostPosted: Wed Sep 29, 2010 2:41 am    Post subject: Reply with quote

That sounds great! How do you identify lines in the log pertaining to a copied file entry? thanks
_________________
--
TGRMN Software Support
http://www.tgrmn.com
http://www.compareandmerge.com
Back to top
Wollrabe



Joined: 26 Aug 2010
Posts: 35

PostPosted: Wed Sep 29, 2010 4:50 pm    Post subject: Parsing the log file for copied files Reply with quote

Using a VBScript,

1) I read through each line of the log file
2) In a loop, as i read each line, and check to see if "Copying file" and "<to>" is in the string.
3) If it finds those two strings, it creates an array, delimited with a "|"
4) Then I assign a variable, using the Split command, I split on the "|" delimiter. That gives me a variable that contains the single string that has both the Copied file and <to> strings, the Source and Target.
5) Then in another loop on the above array, I do two more Splits, 1) assign a variable splitting on the <to>, then creating an array delimited by a "|". Now I have a array with all the Target paths! 2) assign a variable splitting on "Copying File", then creating an array delimited by a "|". Now I have a array with all the Source paths which includes the file names.
6) I then assign two more variables, using the Split command on the above two arrays, splitting on the "|". creating an array that contains all the Source paths, and another array containing only the Target paths. When I build those arrays, I check to see if the path is already in the list, if it is, I only add it to the list once. That way if you had a bunch of pairs Source/Target, and they all come from the same Source, you are not getting duplicate paths listed.
7) I then build a HTML page with a table and cells, and I output those arrays into the HTML output.
Cool At the end of the script I prompt the user if he wants to Delete the files from the Source location. If Yes, I loop through that Source array I created above and delete the items.

Works pretty slick! Gave a demo and got rave reviews! Love ViceVersa!!
Back to top
TGRMN Software
Site Admin


Joined: 10 Jan 2005
Posts: 8467

PostPosted: Thu Sep 30, 2010 3:35 am    Post subject: Reply with quote

Pretty smart! Very Happy

Also <to> can't happen in any file name , because < and > are not allowed in files or paths on Windows, which guarantees the split will always work. Well done! Cool
_________________
--
TGRMN Software Support
http://www.tgrmn.com
http://www.compareandmerge.com
Back to top
Wollrabe



Joined: 26 Aug 2010
Posts: 35

PostPosted: Thu Sep 30, 2010 3:43 pm    Post subject: Exactly! Reply with quote

Exactly! I'm still testing, but I haven't got it to fail yet!
Back to top
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Wish List All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group
Copyright © TGRMN Software. TGRMN Software products: