topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 3:37 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: DONE: Organize files into folders based on flename wildcard parsing  (Read 96802 times)

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Give this a test (source/binary included): File Punter

It's not fully feature complete as of yet but the core functionality is in there.  It should be pretty intuitive.

1) Use the top section to create and add your match filters to the list.
2) Checkmark the rows you want to process.
3) Choose your method at the bottom and click Start.  Progress and such is shown in the statusbar.  You can cancel at any time.
4) All checked rows will be processed in order.  You can move highlighted rows up and down through the list with ctrl-up and ctrl-down before clicking Start.
5) You can delete rows by highlighting and pressing delete.
6) The list is saved/loaded automatically when you close/launch the app.  No other settings are saved at this point.

The three methods you can choose from are:

1) Copy files to destination.  Self-explanatory.
2) Move files to destination.  Self-explanatory.
3) Simulation only.  This mode won't touch your files.  It will just create a text report that will show which files matched your filters and their destinations.  You can use it as a sort of "test run" mode.  Keep in mind that if your filter matches a very large number of files, the resulting text file can get pretty large, too.  Depending on path lengths involved, figure about a meg per 9000 lines/matches.

Put it through its paces and let me know how it works out for you.  If it seems solid enough, I'll add in my usual Skwire Empire stuff and release it as a full-fledged app.  Thanks and apologies for the delay in getting this to a release candidate.

2010-03-12_103123.pngDONE: Organize files into folders based on flename wildcard parsing
« Last Edit: March 12, 2010, 10:36 AM by skwire »

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,959
    • View Profile
    • Donate to Member
I studied programming waaaay back in the 70's (BASIC, COBOL and FORTRAN on an NCR mini coding onto 80-column  punch-cards!) which, while they are certainly not current languages, should give me some structural guidelines. I've also coded in dBase IV and similar (Foxbase etc.) and in  VBasic. In fact, I ran the very first BBS here in town on a 300 baud dialup modem using a Z80 computer running the entire system in interpreted BASIC!

Hi Mick,
an off-topic note:
you may be interested in this thread: In rememberance of....The antiquated hardware/software reminiscence thread
Tom
Tom

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
As an aside, keep in mind that this has had, obviously, minimal testing.  In other words, I'd make some backup copies of your photos first.   :D

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 178
    • View Profile
    • Donate to Member
IDEA: Extended function for Files2Folder
« Reply #28 on: February 11, 2011, 08:27 AM »
Hello, hopefully in this my first post, I get things right.


First Files2Folder is a great utility

The thought I have which may be a new utility or enhancement of the existing.

I often encounter files in the following formats

first part - middle part - last part.extension
or
first part - last part.extension

It would be nice to be able to select a group of files and have the utility folderise by a defined segment, though to make it easier.

option 1
Anything before the first " - "

option 2
Anything after the last " - " (ignoring extension)

There may be other cases, but I suspect it would be more complex to handle.

When run the utility would create folders based on content for the defined option.

If a folder already exists, there is no need to create

Files are then added to the appropriate folder.

In case of duplicates, files are enumerated, or ignored, though in theory this should not happen from an existing folder, but may if further files are added for subsequent processing.


I am guessing there may already be something out there that does this, but I have yet to find it. And then probably nothing with the simplicity of Files2Folder

Thanks in advance

 
Why an I Magician62? Because Magician1 thru 61 were gone. :)

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: IDEA: Extended function for Files2Folder
« Reply #29 on: February 11, 2011, 11:42 PM »
Hello, hopefully in this my first post, I get things right.

Welcome to DonationCoder.  Thanks for posting and enjoy your stay.

First Files2Folder is a great utility

I'm glad you find it useful.   :)

The thought I have which may be a new utility or enhancement of the existing.

I often encounter files in the following formats

first part - middle part - last part.extension
or
first part - last part.extension

It would be nice to be able to select a group of files and have the utility folderise by a defined segment, though to make it easier.

option 1
Anything before the first " - "

option 2
Anything after the last " - " (ignoring extension)

I think this is well out of scope for Files2Folder but you're in luck.  I have another application that I haven't fully released that should do what you want.  What it lets you is specify source folders and then write a simple regular expression with which you can create destination folders that uses data matched by the regular expression.  If you're not familiar with regular expressions, that description probably won't make much sense so here's an example (based off of yours):

Source folder:         c:\path\to\
Containing files like: first part - middle part - last part.extension
RegEx string:          (.*?) - (.*?) - (.*?).extension
Destination folder:    c:\path\to\??2


Each "(.*?)" represents a matched subpattern.  I've highlighted in red the second matched subpattern and how you could use it to automatically create a destination folder based off of text within the filename.  The app then gives you the option to copy, move or simulate.  Based on the above, it would copy/move said file to the following:

c:\path\to\middle part\first part - middle part - last part.extension

Does that make sense?  Would you be interested in something like this?

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: IDEA: Extended function for Files2Folder
« Reply #30 on: February 11, 2011, 11:55 PM »
Also, can you give me more information on the types of files you want to shift around?  Are they music files by chance?

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 178
    • View Profile
    • Donate to Member
Re: IDEA: Extended function for Files2Folder
« Reply #31 on: February 12, 2011, 05:15 AM »
Many thanks for the response. The description I gave was in the simplest form, as I can see other potential later. I am actually sorting pictures

The idea came from using Calibre and how it stores ebooks based on regular expressions. Unfortunately it puts each item into a subfolder of the group, rather than directly in the group, which would have meant i could have used Calibre to do the grouping.

The problem is selecting the images into sets. Most have one or other of the formats mentioned for the filenames, but there are multitudes of variants, and the list is continually growing. Automating the folderising would reduce the biggest manual part of the process to an insignificant number.

Once grouped, they can be placed in CBR format and loaded into calibre as sets or stored elsewhere.

So it does sound like what you have may work, I can always give it a try, maybe iron any bugs too if they exist
Why an I Magician62? Because Magician1 thru 61 were gone. :)

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: IDEA: Extended function for Files2Folder
« Reply #32 on: February 12, 2011, 06:28 AM »
Would you mind giving me some examples of the filenames and paths you're working with as well as how/where you would like them to end up?  If they're sensitive names, either change them or PM me the list.  I can then let you know if this application will work for you.

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 178
    • View Profile
    • Donate to Member
Re: IDEA: Extended function for Files2Folder
« Reply #33 on: February 12, 2011, 07:30 AM »
Many thanks for the quick reply.

The structure is in many ways quite simple, and I can adjust some of it if needed as I go, such as moving each set files to source folder, which effectively elliminates the possibilities of collisions.

Once a batch has been processed, I can physically move the generated folders to a new location, before processing another set. They can then be moved on completion, and windows can handle the collisions for me, and i can the adjust the folder name if needed.

In the following examples i can put "myfolder" anywhere needed in the path i.e. drive:\\myfolder if it makes things easier.

Most of the images are either in the format

myfolder\image00001 - location.jpg
or
myfolder\location - image00001.jpg

There are a number where I incorporate date such as

myfolder\image00001 - location 15-02-2004.jpg
or
myfolder\2004-02-15 location - image00001.jpg
or
myfolder\location 15-02-2004 - image00001.jpg

In these cases i can see the extra "-" being a possible problem, but i can work around that as once they are in their sets, I have other tools I can utilise.

There are also a few files in the format

location - 15022004 - image00001.jpg

But i have means to easily remove the first "-" so reducing it to one of the previous variants.


Destination for each set would be
mydestinationfolder\location\

Though as we are only starting in

myfolder\

and there are no existing subfolders, unless there is a programming reason, I can see no reason why the destination can't just be

myfolder\location\
Why an I Magician62? Because Magician1 thru 61 were gone. :)

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: IDEA: Extended function for Files2Folder
« Reply #34 on: February 12, 2011, 08:38 AM »
In the following examples i can put "myfolder" anywhere needed in the path i.e. drive:\\myfolder if it makes things easier.

The application lets you make a list of source/pattern/destination entries and save them.  Sort of like a profile.  You can use simple wildcard matching to move files but, in your case, you will need to use regular expressions since you want to move them to dynamically created destinations.  After setting up your entries, you can then check/uncheck entries as necessary and only run those.  Here's a screenshot:

2011-02-12_084000.pngDONE: Organize files into folders based on flename wildcard parsing

Most of the images are either in the format

myfolder\image00001 - location.jpg
or
myfolder\location - image00001.jpg


There are a number where I incorporate date such as

myfolder\image00001 - location 15-02-2004.jpg
or
myfolder\2004-02-15 location - image00001.jpg
or
myfolder\location 15-02-2004 - image00001.jpg


In these cases i can see the extra "-" being a possible problem, but i can work around that as once they are in their sets, I have other tools I can utilise.

Shouldn't be a problem with regular expressions.

There are also a few files in the format

location - 15022004 - image00001.jpg

But i have means to easily remove the first "-" so reducing it to one of the previous variants.

Again, regular expressions should easily be able to work around this.

Destination for each set would be
mydestinationfolder\location\

Though as we are only starting in

myfolder\

and there are no existing subfolders, unless there is a programming reason, I can see no reason why the destination can't just be

myfolder\location\

Yep, not a problem.  The software offers a test mode that creates a text file of what will be move/copied and where.  This way, you can test your regular expression to see if it does what you want.  If you use instant messaging, feel free to add any of the accounts here:

http://skwire.dcmemb...wb/pages/contact.php

If you don't mind and, since this app hasn't been released to too many people, I'd like to work with you directly to make sure it does what you want.
« Last Edit: February 12, 2011, 08:41 AM by skwire »

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: IDEA: Organize files into folders based on flename wildcard parsing
« Reply #35 on: February 13, 2011, 03:05 PM »
Magician62 has been doing some really good testing of File Punter on his image files and, I'm happy to say, we've got File Punter to what I feel comfortable for a Skwire Empire release.  Thanks, magician62!   :Thmbsup:

I also merged his topic into this original File Punter thread.

Website | Download
v1.0.4 - 2011-02-13
    * Made simulation mode the default option.  (Thanks, magician62)
« Last Edit: February 13, 2011, 06:05 PM by skwire, Reason: Fixed my typo of magician62\'s nick. Thanks, 4wd. =] »

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,641
    • View Profile
    • Donate to Member
Re: IDEA: Organize files into folders based on flename wildcard parsing
« Reply #36 on: February 13, 2011, 05:53 PM »
Thanks, magician32!   :Thmbsup:

It obviously took it's toll on him :)

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: IDEA: Organize files into folders based on flename wildcard parsing
« Reply #37 on: February 13, 2011, 06:06 PM »
It obviously took it's toll on him

OMG...fixed!  Thanks.  =]

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 178
    • View Profile
    • Donate to Member
Re: DONE: Organize files into folders based on flename wildcard parsing
« Reply #38 on: February 15, 2011, 05:02 PM »
One issue found during testing which was not reproducible other than on my own system was the case of only Deskop and Current User appearing in the Browse for Folder Dialogue box for add /edit entry. It was believed that it might be Win7-64.

Well discovered the cause/fix as I also found another until had started to encounter the same issue. elsewhere.  You can read about it yourselves at Browse For Folder -- Missing Computer,and Libraries

But in summary, there is a limit on the number of icons on the desktop. When you exceed the number say byebye Browse For Folder functionality.
Why an I Magician62? Because Magician1 thru 61 were gone. :)

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Website | Download
v1.0.5 - 2012-06-18
    + Added "Create shortcuts" mode.  (Thanks, nkormanik)
    + Added Check/Uncheck toolbar buttons.

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 552
    • View Profile
    • Donate to Member

Two enhancement requests:

1)  Skwire, I do feel it would be quite a bit more reassuring to show the total number of lines/commands selected to be seen somewhere -- status line or elsewhere.  I'd just feel more at ease seeing that number.

2)  Perhaps, also, allow configuration .ini to set default location in which to begin, from which to open text files containing command lines.  My preference is to look in same directory where the executable is.  For whatever reason when I say Open, File Punter wants to look in Desktop.  I keep all the text file commands within the File Punter executable directory buried somewhere else.

Thanks!

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Website | Download
v1.0.6 - 2012-06-22
    + Last used folder is remembered for File, Open action.  (Thanks, nkormanik)
    + Added status bar section showing total number of rows and total number of
      checked rows.  (Thanks, nkormanik)

y0himba

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 448
  • Yar.
    • View Profile
    • y0himba.net
    • Read more about this member.
    • Donate to Member
Re: DONE: Organize files into folders based on flename wildcard parsing
« Reply #42 on: January 03, 2013, 10:46 AM »
Not to resurrect a dead thread, but I have been using File Punter a lot.  I was wondering if there is command line support?  I would like ot be able to use task manager to run it at a regular interval to organize files.  The Perl flavored RegEx is beautiful.

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: DONE: Organize files into folders based on flename wildcard parsing
« Reply #43 on: January 03, 2013, 11:08 AM »
Unfortunately, no, there isn't any command-line support for this application.   :(

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 178
    • View Profile
    • Donate to Member
File Punter - BUG
« Reply #44 on: October 26, 2013, 04:20 PM »
For source dir you can use a network location

\\NAS\START

but you can not use for destination.

On Update Entry

Error dialogue
Destination DRIVE does not exist. Please chose a valid destination.

At present the only solution is to map the drive to a letter.
Why an I Magician62? Because Magician1 thru 61 were gone. :)
« Last Edit: November 24, 2013, 07:44 AM by magician62 »

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 178
    • View Profile
    • Donate to Member
Re: File Punter - Feature Requests
« Reply #45 on: November 24, 2013, 07:22 AM »
And to add a feature request or two.

When you start to get long list of options, it would be nice to be able to insert a blank line :)

Additionally, it would be nice to be able to apply to folders. (The contents of the folder would go with the folder to it's new destination no matter what their name)

And one other option, a Notes column to allow us a reminder of what the option was for in the first place :)
Why an I Magician62? Because Magician1 thru 61 were gone. :)
« Last Edit: November 24, 2013, 07:44 AM by magician62 »

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: File Punter - BUG
« Reply #46 on: November 25, 2013, 10:10 AM »
Error dialogue
Destination DRIVE does not exist. Please chose a valid destination.

At present the only solution is to map the drive to a letter.

I did some testing on this and it seems to be an AutoHotkey bug/limitation.  There are a few solutions I can think of:

  • Turn off the sanity checking for the destination drive (I'm loath to do this).
  • Make the sanity checking for the destination drive optional (hidden INI option).
  • Leave it as is so that mapped drives are the solution.


When you start to get long list of options, it would be nice to be able to insert a blank line :)

This shouldn't be a problem.

Additionally, it would be nice to be able to apply to folders. (The contents of the folder would go with the folder to it's new destination no matter what their name)

Ehhh...I'll have to give this some thought.  No promises on this one.

And one other option, a Notes column to allow us a reminder of what the option was for in the first place :)

Good idea, actually, and easily doable.
« Last Edit: April 11, 2016, 12:44 PM by skwire, Reason: Grammar/typo fix. »

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: File Punter - BUG
« Reply #47 on: December 04, 2013, 09:45 PM »
I didn't add the blank line request as I felt it was inelegant.  I'll give it some more thought.  Also, if you don't mind, I'd like to merge this thread with the original File Punter thread.

Website | Download
v1.0.7 - 2013-12-04
    + Drag-n-drop reordering in the listview is now possible.
    + Added icons to the menus.
    + Added description column.  (Thanks, magician62)
    * Application is now DPI aware.
« Last Edit: December 04, 2013, 09:54 PM by skwire »

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 178
    • View Profile
    • Donate to Member
Re: File Punter - BUG
« Reply #48 on: December 08, 2013, 03:20 PM »
Hi Jody, sure merge away :) I am at present splitting my time between several time eating tasks and trying to prepare for the holiday season. I have just downloaded and will test shortly.

The odd thing about the path's is that a network location works for the source just not destination.


It doesn't help that I am still installing software after replacing the HDD and starting from scratch in an attempt to find what program has been causing the computer to effectively stall at times, with no obvious processor or memory issues, then it just continues!
Why an I Magician62? Because Magician1 thru 61 were gone. :)

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Website | Download
v1.0.8 - 2014-04-09
    ! Using pipes in pattern strings would screw up their display in the
      dropdown list.  (Thanks, Christian)