|
nkormanik
|
 |
« Reply #25 on: July 17, 2012, 08:56:13 PM » |
|
Well, I'm running out of room on the hard disk (c:) I was using, and need to transfer my contour plot images over to (e:).....
Using Batch Shortcut Modifier, adjusting all the present shortcuts to the images now on the different drive should be a breeze.
Question: If I should decide to convert all the .png image files to .jpg (smaller file size), what would the RegEx code be for the shortcuts modification using BSM? In other words, if any present shortcut contains ".png", change it to ".jpg".
My present BSM.ini file is as follows:
[General] Folder=C:\5\QQQ\shortcuts 1_x_178 PathSearch=C:\\4(.+) PathReplace=C:\\5\1 NameSearch=(.+) NameReplace=\1
Thanks much!
|
|
|
|
|
Logged
|
|
|
|
|
4wd
|
 |
« Reply #26 on: July 17, 2012, 09:22:49 PM » |
|
This should do it: NameSearch=(.+)\.png NameReplace=\1\.jpg You really should have a read of RegEx expressions 
|
|
|
|
|
Logged
|
Four wheel drive: Helping you get stuck faster, harder, further from help...........and it's no different on this forum 
|
|
|
|
nkormanik
|
 |
« Reply #27 on: July 17, 2012, 10:44:29 PM » |
|
NameSearch=(.+)\.png NameReplace=\1\.jpg Something about it seems so foreign and daunting. For now..., glad to have you, Skwire, etc. So the code you provided above will work for shortcuts containing the names of the files, right? I'd think the names would be included in the total path. As I said, hardly makes sense.
|
|
|
|
|
Logged
|
|
|
|
|
|
4wd
|
 |
« Reply #28 on: July 17, 2012, 11:09:08 PM » |
|
NameSearch=(.+)\.png NameReplace=\1\.jpg Something about it seems so foreign and daunting. For now..., glad to have you, Skwire, etc. I don't even pretend to be able to do the things skwire and others can do with RegEx on the forum here but for straight forward things like this I'm OK....until someone corrects me  So the code you provided above will work for shortcuts containing the names of the files, right? Yes. I'd think the names would be included in the total path. No, I chose to treat the file path and file name as two separate entities.
|
|
|
|
|
Logged
|
Four wheel drive: Helping you get stuck faster, harder, further from help...........and it's no different on this forum 
|
|
|
|
nkormanik
|
 |
« Reply #29 on: July 18, 2012, 11:58:15 PM » |
|
4wd, so the file names of shortcuts themselves will not be affected by BSM, only the contents of the shortcuts -- path to target, and filename of the target?
Here is a more complicated task, if you care to help further..., involving BOTH the target path and the target filename:
On drive e: now...
e:\1\QQQ\images\50501\...(16,000 .png images) e:\1\QQQ\images\50502\...(16,000 .png images) e:\1\QQQ\images\50503\...(16,000 .png images) etc.
Within the first folder above are the files....
_50501_20101_20102_.png _50501_20101_20103_.png _50501_20101_20104_.png _50501_20101_20201_.png etc.
Within the second folder above are the files....
_50502_20101_20102_.png _50502_20101_20103_.png _50502_20101_20104_.png _50502_20101_20201_.png etc.
Notice the second (and subsequent) folder's file names are identical to the first, except for the first portion of the file name -- 50501 vs. 50502.
Using a combination of Skwire's FilePunter and 4wd's BSM, I have created a terrific set of shortcuts pointing to the files in the 50501 folder. I regard that shortcut set as my 'gold standard.'
Example of 50501 shortcut -- path + target:
e:\1\QQQ\images\50501\_50501_20101_20102_.png
The trouble now comes in adjusting/modifying the shortcuts for the other folders, say 50502.
e:\1\QQQ\images\50502\_50502_20101_20102_.png
If possible, I'd like to use my 'gold standard' 50501 shortcuts --> copy them to, say, a 50502 shortcuts folder, and give BSM the instructions:
"BSM, take the 50502 folder full of shortcuts, look in there, when you find a path with '50501' change it to '50502.' When you find a target filename with '50501' change it to '50502.'"
If BSM can do that, I'll repeat the process on the subsequent remaining folders.
So, what would be the BSM code for accomplishing the above task?
Present BSM.ini:
[General] Folder=e:\1\QQQ\shortcuts 1_x_178\50502 PathSearch=e:\1\QQQ\images\50501(.+) PathReplace=e:\1\QQQ\images\50502\1 NameSearch=(.+) NameReplace=\1
Thanks much!
|
|
|
|
|
Logged
|
|
|
|
|
4wd
|
 |
« Reply #30 on: July 19, 2012, 04:54:52 AM » |
|
[General] Folder=e:\1\QQQ\shortcuts 1_x_178\50502 PathSearch=(.+)\\50501(.*) PathReplace=\1\\50502\2 NameSearch=_50501(.+) NameReplace=_50502\1
(.+)\\50501(.*) - Group, (1), everything up to \50501 and group, (2), everything after, (even if there's nothing). \1\\50502\2 - Replace with group 1 followed by \50502 followed by group 2.
_50501(.+) - Group, (1), everything after _50501. _50502\1 - Replace with _50502 followed by group 1.
Spent an hour wondering why it wouldn't work until I realised that putting \150502 meant insert everything from group 150502...which doesn't exist. Hence the need to include \\ to search/replace the \ before 50501.
|
|
|
|
|
Logged
|
Four wheel drive: Helping you get stuck faster, harder, further from help...........and it's no different on this forum 
|
|
|
|
nkormanik
|
 |
« Reply #31 on: July 20, 2012, 02:14:27 AM » |
|
4wd's Batch Shortcut Modifier, BSM, just finished adjusting nearly 700,000 shortcuts in a large directory tree -- all without hitch.
Thanks so much, 4wd, for some really helpful software!
Here are some possible enhancement for BSM, but by no means necessary. BSM is great as is presently, in my opinion:
-- Progress indicator while Testing -- I wasn't sure anything was happening, so stopped BSM via Task Manager.
-- Remember preferred size/layout of Test window (BSM.ini file entry?)
-- Remember state of check boxes, such as Recurse on (BSM.ini file entry?)
-- Change Go ---> Stop, once process is underway.
-- Change notice when hovering over Go to "Starts Shortcut Modification"
|
|
|
|
|
Logged
|
|
|
|
|
4wd
|
 |
« Reply #32 on: July 22, 2012, 12:18:28 AM » |
|
4wd's Batch Shortcut Modifier, BSM, just finished adjusting nearly 700,000 shortcuts in a large directory tree -- all without hitch.
Thanks so much, 4wd, for some really helpful software! Good to know at least one of my programs works  - Progress indicator while Testing -- I wasn't sure anything was happening, so stopped BSM via Task Manager. Unfortunately, when it's sitting there looking like it's not doing anything, it's actually recursing through the folders looking for shortcuts, _all_ shortcuts, not just the first 20 for the test output. Because the collecting of shortcuts is performed by an external function written by somoeone else, I'd need to rewrite parts of it to enable some form of indicator/interrupt, something I don't normally like doing because the functions were written by people with far more knowledge in AutoIt than me. The time between the completion of shortcut collection and displaying the test output is less than a second - that bit is outside the above function and that's when the progressbar kicks in, 0->20 in less than a second. I could change the Go->Stop->Go in that period but the change is almost instant - you don't have time to press Stop. -- Remember preferred size/layout of Test window (BSM.ini file entry?) That I can do, requires using another external function but seems easy enough. -- Remember state of check boxes, such as Recurse on (BSM.ini file entry?)
-- Change Go ---> Stop, once process is underway.
-- Change notice when hovering over Go to "Starts Shortcut Modification" They're easy. As I suggested in the TCBOO thread, could you use skwire's ZeroZipper to zip up the tree with all the shortcuts and the tree with all the images, then just attach the archives in a PM - they should only be a few MB in size, then I'll have something to test against.
|
|
|
|
|
Logged
|
Four wheel drive: Helping you get stuck faster, harder, further from help...........and it's no different on this forum 
|
|
|
|
nkormanik
|
 |
« Reply #33 on: July 22, 2012, 01:54:02 AM » |
|
I'm using Folder Monitor (FolMon) all the time now. Another example of your excellent work.
Thinking more about BSM, best to simply leave well enough alone. Works terrifically. Maybe someone else will have a substantive enhancement request at some point. Who knows.
The images file folder = 50 gb One tree of shortcuts = 1.45 gb Another tree of shortcuts = 1.47 gb
I'll try using Skwire's ZeroZipper, and see how that goes.
If not, no worries. Things are now all set up the way I had hoped.
Thanks again for your generous assistance!
|
|
|
|
« Last Edit: July 22, 2012, 02:03:59 AM by nkormanik »
|
Logged
|
|
|
|
|
4wd
|
 |
« Reply #34 on: July 22, 2012, 02:28:17 AM » |
|
Thinking more about BSM, best to simply leave well enough alone.  Does that mean you don't want the radically faster version? Still can't interrupt the fetching of shortcuts but time to fetch is >60% less than previous version, (just changed to using DOS dir command). Now saves test output window size/position and resizes columns to fit contents, saves state of checkboxes, added a statusbar so at least it looks like it's doing something. Haven't done the Go->Stop during processing yet - next day or so should see it finished. Still like a copy of your image/shortcut tree so I can see if I can find where TCBOO is going belly up - the limit on string length is 2,147,483,647 characters, (which is a lot), so it would be interesting to see what's actually failing.
|
|
|
|
|
Logged
|
Four wheel drive: Helping you get stuck faster, harder, further from help...........and it's no different on this forum 
|
|
|
|
nkormanik
|
 |
« Reply #35 on: July 22, 2012, 02:31:28 AM » |
|
My goodness. Definitely would like the new version, then.
I'm not positive how to send a PM. Would you briefly say how?
|
|
|
|
|
Logged
|
|
|
|
|
4wd
|
 |
« Reply #36 on: July 22, 2012, 02:46:15 AM » |
|
Looks like you'll have to email them to me, no attachments in PMs. And for future reference, to send a PM: 
|
|
|
|
« Last Edit: July 22, 2012, 08:05:45 PM by 4wd »
|
Logged
|
Four wheel drive: Helping you get stuck faster, harder, further from help...........and it's no different on this forum 
|
|
|
|
nkormanik
|
 |
« Reply #37 on: July 22, 2012, 02:50:06 AM » |
|
Will do. Zero Zipper is now chugging along.
|
|
|
|
|
Logged
|
|
|
|
|
nkormanik
|
 |
« Reply #38 on: July 22, 2012, 07:42:27 PM » |
|
Will send link by PM to one of those file-sharing sites. Resulting file was too large to send by email.
Using Skwire's Zero Zipper, and letting it keep running while I went to bed:
ContourPlots.zip = 206 mb
I recompressed into .rar format, best compression:
ContourPlots.rar = 80 mb
Hope the file helps with whatever you want to attempt.
|
|
|
|
|
Logged
|
|
|
|
|
4wd
|
 |
« Reply #39 on: July 23, 2012, 04:10:58 AM » |
|
Thanks - I might have to slow it down a bit, it found 768780 shortcuts in 13.5 seconds - hardly enough time to make a cuppa. Slightly better than the 62 seconds that v0.3 took. UPDATE (v0.5) here: - Scanning for shortcuts is a bit faster, (relies on DOS dir command).
- Saves position of main window and test output window, (will be saved when the respective window is closed).
- Saves state of checkboxes.
- Can interrupt shortcut processing, (not scanning though) - log file will open by default when interrupted.
- Added a statusbar so it looks like it doing something.
|
|
|
|
|
Logged
|
Four wheel drive: Helping you get stuck faster, harder, further from help...........and it's no different on this forum 
|
|
|
|
nkormanik
|
 |
« Reply #40 on: July 23, 2012, 03:08:03 PM » |
|
Wow. Pure magic.
Thanks for sticking with it.
Hope others find and use your programs.
|
|
|
|
|
Logged
|
|
|
|
|