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

DonationCoder.com Software > Finished Programs

DONE: Organize files into folders based on flename wildcard parsing

<< < (2/16) > >>

skwire:
MoveOut (as far as I can see) lacks the ability to create the necessary sub-folders and then move the files that meet the wildcard criteria into the self-named newly-created folders.
Did I miss something?
-mickblu (March 04, 2010, 11:56 AM)
--- End quote ---

Ah, apologies.  I didn't realise that MoveOut didn't create the destination folders.  In that case, would it be possible for you to PM me a simple text listing of your image filenames so I can test against them?  I don't need the full paths...just the names.  However, if there are privacy/sensitivity issues with this request, I certainly understand.  In that case, I'll just generate some random filenames based off the patterns in your initial post.  I've got the main framework of your app already finished;  I just need to do a more work on the flow and then some testing.

mickblu:
OK, I've tried to give you some sense of the file naming conventions which are reasonably strict as long as you appreciate that they will always start with a 2 or 3-letter or number group, then an underscore, then a 2 or 3 letter designator (typically but no hard and fast rule) then an underscore and some more letters and/or numbers and perhaps another underscore or hyphen and some more letters or numbers but this last part is not relevant to the project.

So what we need to create is the following structure:

root (could be anywhere)
then the first grouping creates a major subdir named after it (in the examples shown FJ or MA)
then subdirs off those based on the next grouping
then subdirs off that based on third grouping
then all the files that fit that pattern into those dirs so only three levels deep

Basically Photographer then Model then Project then Image Number

I hope you appreciate that I need an automatic process because (currently) there are 21,128 filers (and growing) so any needed manual intervention makes it a very laborious process indeed!

I forgot to ask you whether this process can be recursive because currently I have a mess of files in this monster dir and (more recently) some measure of subdirs off the monster dir named with project names and their contents need to be processed according to the overall rules, so you don't have to care what the dirs are named, just enter and process (I know, I'm not asking for much...)

I hope this makes it clear?

Mike

skwire:
OK, I've tried to give you some sense of the file naming conventions which are reasonably strict as long as you appreciate that they will always start with a 2 or 3-letter or number group, then an underscore, then a 2 or 3 letter designator (typically but no hard and fast rule) then an underscore and some more letters and/or numbers and perhaps another underscore or hyphen and some more letters or numbers but this last part is not relevant to the project.-mickblu (March 04, 2010, 09:37 PM)
--- End quote ---

Well, therein lies the rub.  "Reasonably strict" doesn't equate to "strict" so this will be very difficult to do automatically.  However, read on.

So what we need to create is the following structure:
root (could be anywhere)
then the first grouping creates a major subdir named after it (in the examples shown FJ or MA)
then subdirs off those based on the next grouping
then subdirs off that based on third grouping
then all the files that fit that pattern into those dirs so only three levels deep-mickblu (March 04, 2010, 09:37 PM)
--- End quote ---

At its most basic, what you describe above is very easy to do.  Cracking a filename on its underscores, creating folders, and moving said file into said folder is a piece of cake.  However, since some of your files have three groups and others have four, this is much more difficult to do accurately.  Do you understand what I mean?

For instance, your MA_* files mostly have four groups (three that matter and then the irrelevant counter portion) but your FJ_* files mostly have three groups (two that matter and then the irrelevant counter portion).  Normally, I could take num_groups-1 and go with that but I can't, in this case, since there are example in your images where the MA_* files have three groups and the FJ_* files have four groups.

At this point, I don't feel comfortable writing a parser that goes three levels deep since there is no hard standard to the filenames.  There are a few ways to approach this:

1) You strictly standarise your filenames at which point I can make the parser as creative as you would like.

2) You divvy up your files into groups that contains the same amount of "underscore groups" and then I can offer an option to crack the filenames on first, second, or third groups.

3) I write the app so you can form basic *? type of wildcard matching.  Something like "MA_*_*.jpg" gets filtered to some destination folder you specify.  One drawback here is that each match entry can only have one destination folder.  Another drawback, I suppose, is that the entry will need to be entered manually.  On the other hand, the list of entries is easily saved and reused.  This is how I started writing this app before you mentioned your automatic-filename-cracking request.

I hope you appreciate that I need an automatic process because (currently) there are 21,128 filers (and growing) so any needed manual intervention makes it a very laborious process indeed!-mickblu (March 04, 2010, 09:37 PM)
--- End quote ---

Sure, I appreciate it but, from my point of the view as the coder who is messing with your files, I have to feel confident that I'm not going to muck them up.

I forgot to ask you whether this process can be recursive because currently-mickblu (March 04, 2010, 09:37 PM)
--- End quote ---

Yes, recursive processing is easily doable.

mickblu:
Hi Skwire,

I appreciate your dilemma, and I think your solution #3 is the best where you allow me to put in the search criteria in the form of a wild-card string. That wouldn't bother me at all as there are really only the two naming conventions (3 group and 4 group) but at least that way any other eventuality is easily handled.

I look forward to hearing from you,

Mike

mickblu:
Hi Skwire,

I was just wondering where we were at with the "project" as it's been over a week and I hadn't heard back from you.

Sincerely,

Mike

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version