ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Finished Programs

DONE: Shortcuts Creator

(1/5) > >>

nkormanik:
I've encountered a new need hopefully one of you can help with:

Given:  One folder full of large-sized image files, around 15,000 files in all.  Called IMAGE FOLDER.

Task: 
-- Create another folder outside of IMAGE FOLDER with name XXX01 FOLDER.
-- For any images in IMAGE FOLDER whose name has "XXX01" in it, create a shortcut within XXX01 FOLDER to those images.

-- Create another folder outside of IMAGE FOLDER with name XXX02 FOLDER.
-- For any images in IMAGE FOLDER whose name has "XXX02" in it, create a shortcut within XXX02 FOLDER to those images.

-- Create another folder outside of IMAGE FOLDER with name XXX03 FOLDER.
-- For any images in IMAGE FOLDER whose name has "XXX03" in it, create a shortcut within XXX03 FOLDER to those images.

etc.

In total there will be 180 of these shortcut folders needing to be created.  Each of these shortcut folders will have around 180 shortcuts in it.

Challenge:
Write program that does the above automatically.
Input --- folder in which to search.
Input --- what exactly to look for.
Input --- list of new folders to create.
Go!

Thanks to all of you.

Nicholas Kormanik
[email protected]

skwire:
I could add another output method to my File Punter application and it should do what you want.  You'd have to use a little bit of RegEx but that's not so hard.  =]

nkormanik:
What a saint!!  Just please guide on the RegEx, as sometimes it's a bit tricky.

Is the explanation of what I'm trying to do clear enough?

Creating the shortcuts in the folders is my attempt not to have to copy the image files themselves over and over and over again into the various folders.

The names of the image files include at least two of the searched-for snippets.

Example:  XXXX32_XXXX79.png

Thanks so much!

Hope this will be useful to others as well.

skwire:
So, given this filename: XXXX32_XXXX79.png

What do you want to match on?

If you could provide me, in a PM or something, a sample list of the actual filenames (and subsequent matches), that would be most helpful for testing.  Feel free to look up my profile and contact me via any of the instant messengers there.

nkormanik:
Given the filename XXXX32_XXXX79.png....

I will be matching on two snippets, if manually in two different steps.

First I'll be matching on "XXXX32".  Creating a folder XXXX32.  And putting a shortcut to the file XXXX32_XXXX79.png within that folder.

Then I'll be matching on "XXXX79".  Creating a folder XXXX79.  And putting a shortcut to the file XXXX32_XXXX79.png within that folder.

As background to what I'm attempting to accomplish:

The image files are 'contour plots' of the two variables, in the present case variables 32 and 79.

Within XXX32 folder, there will be shortcuts to all the contour plots which variable 32 plays a part.

So, in XXX32, there will be shortcuts to the following image files:

XXXX32_XXXX01.png
XXXX32_XXXX02.png
XXXX32_XXXX03.png
XXXX32_XXXX04.png
.
.
.
XXXX32_XXXX180.png

Having all the variable 32 shortcuts in one folder -- XXX32 -- would allow me to focus on just those images at one time.

Then I could move on to the variable 33 folder -- XXX33 -- for instance, and look at just the images where variable 33 plays a part.

Navigation

[0] Message Index

[#] Next page

Go to full version