topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Tuesday March 19, 2024, 5:48 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

Author Topic: pyrohacker  (Read 61903 times)

pyrohacker

  • Member
  • Joined in 2008
  • **
  • Posts: 46
  • Coder, gamer, loving it.
    • View Profile
    • Mindful Code
    • Read more about this member.
    • Donate to Member
pyrohacker
« on: December 13, 2009, 08:39 PM »
NANY 2010 Entry Information

Application Name SubDiv
Version 1.2
Short Description Organize your changing folders
Supported OSes MS Windows (All)
Web Pages - You're looking at one.
- GitHub Repo
Download Link See GitHub.
System Requirements
  • Windows
  • A folder
Version History
  • 1.2 - Updated format + 2 new features
  • 1.0 - First working version
Author pyrohacker


Description

SubDiv was built to organize folders that are constantly being filled with new content, such as a 'Downloads' folder. When you are continually throwing files from the Internet into a folder on your computer, that folder becomes very disorganized (at least for me). SubDiv will take those files and put them into folders based on the day they were created.

Features
Portable - Program is drive-independent and saves settings using .ini files, so it can be placed on any computer.
Currently sorts based on the day that a file was created.

Planned Features by Priority
  • Multiple date formats - Semi-done! (currently supports two separators.)
  • Multiple sorting methods - File extension, Alphabetical, & possible others
  • Multiple work modes - Update or Constant Monitor
  • Optional recursive sorting of subfolders - Done! (Thanks, doctorfrog!)
  • Optional sorting of subfolders themselves
  • Independent website
  • Help file (only if it becomes complex enough)

Possible Features (not set in stone)
  • Undo feature - Probable, but not a priority.
  • Custom user sort fields - Not for a long time, but keep your hopes up!

Screenshots
SubDiv Screenshot 2.jpgpyrohacker NewScreenshot.pngpyrohacker

Usage

Installation
Place the .exe file into the folder you wish to have sorted.

Using the Application
Run the program! Current settings are:
  • Recurse - take files from sub-folders and sort them as well.
  • Cleanup - delete empty folders every time a files are sorted.

Uninstallation
Delete the .exe file and the .ini file. Please note, however, that there is no way to undo sorting at this time.

Known Issues
No issues that I'm aware of, other than incompleteness!

It's difficult to test a program that is based on taking a long time. Let me know if you run across any bugs.



Since I don't know how to manage files and folders in C++, this project has been made in AHK.
Any suggestions would be warmly welcomed!
Funny that programmers chose the phrase "Hello, World" while most of us are introverts.
« Last Edit: November 20, 2013, 12:16 AM by pyrohacker, Reason: pyrohacker »

techidave

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 1,044
    • View Profile
    • Donate to Member
Re: NANY 2010 Teaser: SubDiv
« Reply #1 on: December 28, 2009, 05:46 AM »
Sounds like a useful app.  Any word on a release?

supermamon

  • Participant
  • Joined in 2009
  • *
  • Posts: 1
    • View Profile
    • Donate to Member
Re: NANY 2010 Teaser: SubDiv
« Reply #2 on: December 28, 2009, 08:06 PM »
Not meant to discourage but maybe you can get some inspiration from Belvedere
Maybe adding options to dynamically create folders based on date, or put up some pre-defined rules like, auto-sort by extension and create folders based on the extensions and/or type. Example predefined rules would be:
*.pdf --> Goes to PDF folder
*.xls; *.doc; *.ppt --> goes to MSOffice folder
*.jpg;*.gif;*.png --> goes to Images folder

...and yes, it's great that it will be a portable app.

pyrohacker

  • Member
  • Joined in 2008
  • **
  • Posts: 46
  • Coder, gamer, loving it.
    • View Profile
    • Mindful Code
    • Read more about this member.
    • Donate to Member
Re: NANY 2010 Final Release: SubDiv
« Reply #3 on: January 01, 2010, 12:34 AM »
Phew!  I cut it a bit too close, but SubDiv has been released!  The current version is limited, but more development will follow!

All suggestions are welcome, but I probably won't be able to address most of them.
Funny that programmers chose the phrase "Hello, World" while most of us are introverts.
« Last Edit: January 01, 2010, 12:42 AM by pyrohacker »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: NANY 2010 Final Release: SubDiv
« Reply #4 on: January 01, 2010, 12:45 AM »
Seems to work as advertised  :up:
Utimately would be nice to not have to copy the subdiv program into the folder you want to sort and have some more options, but it's off to a good start.

wr975

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 369
    • View Profile
    • Donate to Member
Re: NANY 2010 Teaser: SubDiv
« Reply #5 on: January 04, 2010, 10:02 AM »
Not meant to discourage but maybe you can get some inspiration from Belvedere
Maybe adding options to dynamically create folders based on date, or put up some pre-defined rules like, auto-sort by extension and create folders based on the extensions and/or type. Example predefined rules would be:
*.pdf --> Goes to PDF folder
*.xls; *.doc; *.ppt --> goes to MSOffice folder
*.jpg;*.gif;*.png --> goes to Images folder

...and yes, it's great that it will be a portable app.

You can also try this tool...

https://www.donation....msg159246#msg159246

Would be great if pyrohacker adds the same features in his tool. Especially the "keep .ini and .exe together" feature request was a great idea.

doctorfrog

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 140
    • View Profile
    • Donate to Member
Re: NANY 2010 Final Release: SubDiv
« Reply #6 on: January 04, 2010, 03:15 PM »
I was pretty tickled with how this program ripped through my cloudy downloads folder, until I realized that the way it names folders results in an out-of-chronological-order mess...



It's still a nice idea for Chronic Downloader's Remorse.

Suggestions:

1. Please use a folder naming convention that 'naturally' sorts by date, ie. 2009-03-15
2. Include an 'undo' feature.
3. Include a feature that optionally recursively sorts subfolders. In other words, it reaches into every folder, digs out everything and dumps it into the root folder, deletes all empty folders, then re-sorts based on file date. Definitely will want to include an "Are you really, really, really sure?" confirmation dialog for this.

pyrohacker

  • Member
  • Joined in 2008
  • **
  • Posts: 46
  • Coder, gamer, loving it.
    • View Profile
    • Mindful Code
    • Read more about this member.
    • Donate to Member
Re: NANY 2010 Final Release: SubDiv
« Reply #7 on: January 04, 2010, 09:31 PM »
Wow, these are some great suggestions and examples!  If they all come to pass, SubDiv will be more complex and useful than I originally had in mind ... I can't wait!

My Christmas Break is over, so development is going to have to slow down, but I don't intend to stop with version 1.0!  Just wondering, what are some opinions of the icon?  It was somewhat thrown together, so it's not the best I can do.

(The .ahk code is now hosted on a RedMine project, if anyone wants to take a look at it.)
Funny that programmers chose the phrase "Hello, World" while most of us are introverts.
« Last Edit: January 06, 2010, 11:01 PM by pyrohacker »

dilligaff

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 1
    • View Profile
    • Donate to Member
Re: NANY 2010 Final Release: SubDiv
« Reply #8 on: January 06, 2010, 11:12 AM »
out-of-chronological-order mess... Just Windows default behavior - does date sorting on a character-by-character basis,and the default North American convention of mm-dd-yy means that the year gets parsed last. Suppressed/implicit leading zeroes also cause some weird behavior in the sorts, in my experience,too.
see <http://forums.cnet.com/5208-6142_102-0.html?threadID=292241> for a discussion of this problem, and M$ other sorting inconsistencies at <http://support.microsoft.com/default.aspx?scid=kb;en-us;318872>. The photo cataloging software I currently use has the option to use the date embedded in the EXIF data,or add info to the ITPC metadata.

doctorfrog

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 140
    • View Profile
    • Donate to Member
Re: NANY 2010 Final Release: SubDiv
« Reply #9 on: January 06, 2010, 07:03 PM »
M$

Using the format "2010_01_06" works fine for me. Actually, it's also the folder sorting technique my image organizing software employs.

The underscores seem to break up the name enough so that Windows sorts properly, and doesn't need any special date-smart x-ray vision. Those of us in the USA can deal with the communist-inspired y/m/d order. I submit it as the easiest way to go.

Tuxman

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,466
    • View Profile
    • Donate to Member
Re: NANY 2010 Final Release: SubDiv
« Reply #10 on: January 08, 2010, 10:36 PM »
A new suggestion: Regex based sorting. If a file matches a certain expression, put it into $folder.

Perry Mowbray

  • N.A.N.Y. Organizer
  • Moderator
  • Joined in 2005
  • *****
  • Posts: 1,817
    • View Profile
    • Donate to Member
Re: NANY 2010 Final Release: SubDiv
« Reply #11 on: January 12, 2010, 06:14 PM »

pyrohacker

  • Member
  • Joined in 2008
  • **
  • Posts: 46
  • Coder, gamer, loving it.
    • View Profile
    • Mindful Code
    • Read more about this member.
    • Donate to Member
Re: NANY 2010 Final Release: SubDiv
« Reply #12 on: January 12, 2010, 08:08 PM »
Thanks for letting me know, Perry!  It's good to see NANY getting some publicity.
Funny that programmers chose the phrase "Hello, World" while most of us are introverts.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: NANY 2010 Final Release: SubDiv
« Reply #13 on: January 20, 2010, 05:25 PM »

pyrohacker

  • Member
  • Joined in 2008
  • **
  • Posts: 46
  • Coder, gamer, loving it.
    • View Profile
    • Mindful Code
    • Read more about this member.
    • Donate to Member
Re: NANY 2010 Final Release: SubDiv
« Reply #14 on: January 26, 2010, 09:49 PM »
SubDiv V1.2 has been unleashed!

New features include a true date format that will sort itself.  Sorry for not realizing that at first.  Also, the recursing idea has been implemented, as well as an unplanned feature: Cleanup.  When SubDiv detects an empty folder, it gets deleted.

Again, a lot of this is untested, so let me know as soon as any issues pop up.  I'm trying to find a good place to manage all of the feedback.  RedMine's nice, but I'd prefer if users didn't have to register.  Any suggestions?
Funny that programmers chose the phrase "Hello, World" while most of us are introverts.

adi_barb

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 71
  • Knowledge comes, but wisdom lingers.
    • View Profile
    • Donate to Member
Re: NANY 2010 Final Release: SubDiv
« Reply #15 on: December 13, 2010, 05:58 AM »
Why is SubDiv famous?

SubDiv is famous because it is a simple tool that allows you to manage and organize folders content.  :Thmbsup:

scasplte2

  • Participant
  • Joined in 2011
  • *
  • default avatar
  • Posts: 1
    • View Profile
    • Donate to Member
Re: NANY 2010 Final Release: SubDiv
« Reply #16 on: February 02, 2011, 02:06 PM »
First off, thank you so much for this nifty program. I was wondering is there anyway to change the date SubDiv looks at to create the folders?
Specifically, I am trying to organize a bunch of files and I wrote a program to go into each subdirectory and move certain filetypes to a specified folder. However, this action seems to rewrite the Date Created metadata leaving the original Date untouched and it is this date that I would like to sort by.
« Last Edit: February 02, 2011, 02:08 PM by scasplte2 »

pyrohacker

  • Member
  • Joined in 2008
  • **
  • Posts: 46
  • Coder, gamer, loving it.
    • View Profile
    • Mindful Code
    • Read more about this member.
    • Donate to Member
Re: NANY 2010 Final Release: SubDiv
« Reply #17 on: November 02, 2013, 06:26 PM »
I'm reviving this thread to ask for help. I have lost SubDiv, both source and executable. A user has expressed interest in finding it, and I'm hoping that someone still has some part of it.

My apologies for raising the dead. If anyone has the executable or source code for SubDiv — any version number — please either post it or send it to me (email visible on profile page).
Funny that programmers chose the phrase "Hello, World" while most of us are introverts.

Shades

  • Member
  • Joined in 2006
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: NANY 2010 Final Release: SubDiv
« Reply #18 on: November 03, 2013, 08:27 AM »
The version I have  (executable only, version 1.0.48) is sent to the mail address I found on the web page your profile links to. The mail address is hidden on your profile.

A "strange" way of cloud back up  :P

Andreasvb

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 1
    • View Profile
    • Donate to Member
Re: pyrohacker
« Reply #19 on: July 17, 2016, 04:52 AM »
Hi, I got a slightly modded version of your code.

I used this before and thought I would sort my download-folder now, but it didn't work today (Windows 10).
Thought I would see if there was an update for it, and read that you lost it.

Also, I wanted only the year, so I put together a little bat script instead. :)

Used some bits from these 2 to get it working so it will not move any .bat:
http://stackoverflow.com/a/22222204 [Batch file to move file based on Month & Year on Date modified to folder with YYYY_MM]
http://stackoverflow.com/a/863627 [In a batch file, how do I delete all files NOT of a certain type]

Code: Visual Basic [Select]
  1. @echo off
  2. cls
  3. choice /c yn /t 10 /d n /m "move all files divided by year?"
  4. if errorlevel 2 goto stop
  5. for %%f in ("%cd%\*") do if not %%~xf==.bat (
  6.   for /f "tokens=1 delims=- " %%a in ("%%~tf") do (
  7.     if not exist "%cd%\%%a" mkdir "%cd%\%%a"
  8.     move "%%~f" "%cd%\%%a"
  9.   )
  10. )
  11. cls
  12. echo all done!
  13. timeout 10
  14. :stop
  15. exit



Here's the code for your script (modded for YYYY-MM)
Code: Autohotkey [Select]
  1. /*
  2. SubDiv
  3. created by pyrohacker on the D.C. Forum
  4. as a NANY 2010 Entry.
  5. */
  6.  
  7. SetWorkingDir %A_ScriptDir%
  8. Menu, TRAY, Icon,,, 1
  9.  
  10. ; Set up GUIs and variables
  11.  
  12. Setup:
  13.  
  14.  
  15. Separator=%SeparatorSelection%
  16. Cleanup=%CleanupSetAt%
  17.  
  18. FormatTime, CurrentYear,, yyyy
  19. FormatTime, CurrentMonth,, MM
  20. FormatTime, CurrentDay,, dd
  21.  
  22. ; Create the settings dialog
  23. Gui, 3:Add, Text,, Creates folders: Year && Months`n:: Andreasvb 2012 mod ::
  24. FormatTime, SmartDate,, yyyy - M - d
  25. Gui, 3:Add, Text,, Please select a date separator:
  26. Gui, 3:Add, Radio, Checked%UnderscoreOn% vSeparatorSelection, Underscore ( _ )
  27. Gui, 3:Add, Radio, Checked%HyphenOn% y+0, Hyphen ( - )
  28. Gui, 3:Add, Radio, y+15 Group Checked, Update Mode
  29. Gui, 3:Add, Radio, y+0 Disabled, Monitor Mode
  30. Gui, 3:Add, Checkbox, y+10 %Recursive% vRecurseSetAt, Recursive subfolders
  31. Gui, 3:Add, Checkbox, y+5 %Cleanup% vCleanupSetAt, Delete empty folders
  32. Gui, 3:Add, Button, y+20 x20 w70 gSendSettings, Apply
  33. Gui, 3:Add, Button, x+15 w70 gActions, Cancel
  34.  
  35. Start:
  36.  
  37. ; Create the Main Actions Dialog
  38. Gui, 2:Add, Button, vUpdate gSortNow h120 w120, Sort this folder now
  39. Gui, 2:Add, Button, vSettings gShowSettings x+0 h120 w120, Change settings
  40. Gui, 2:+ToolWindow
  41. Gui, 2:Show, Center, SubDiv
  42. Pause On
  43.  
  44. Actions:
  45. Pause Off
  46. Gui, 3:Hide
  47. Gui, 2:Show, Center, SubDiv
  48. Pause On
  49.  
  50. SortNow:
  51. Pause Off
  52. Loop %A_WorkingDir%\*, 0, %Recursive% ; Retrieve a list of files to be sorted
  53.         NewFiles = %NewFiles%%A_LoopFileName%`n
  54. UpdateFolders()
  55. StringTrimRight, SortTime, %A_Now%, 6
  56. if Separator = 1
  57.         UnderscoreSort()
  58. if Separator = 2
  59.         HyphenSort()
  60. if ErrorLevel = 0
  61.         GoSub Problems
  62. MsgBox Finished sorting %A_WorkingDir%!
  63. GoSub EndProg
  64.  
  65. UpdateFolders()
  66. {
  67. global
  68.  
  69. If (Cleanup == 1) {
  70.  
  71. Loop, *, 2,
  72. {
  73.   Size = 0
  74.   Loop, %A_LoopFileName%\*, 1, 1
  75.   {
  76.     Size += %A_LoopFileSize%
  77. }
  78. ;MsgBox Size of %A_LoopFileName% is %A_LoopFileSize% bytes.
  79. If (Size < 1) {
  80. FileRecycle, %A_LoopFileName%
  81. }
  82.  
  83. }
  84.  
  85.  
  86. }
  87. Return
  88. }
  89.  
  90. HyphenSort()
  91. {
  92. global
  93. Loop PARSE, NewFiles, `n
  94. {
  95.         FileGetTime DateCreated, %A_LoopField%, C
  96.         FormatTime, YearCreated, %DateCreated%, yyyy
  97.         NowTime := SortTime
  98.         EnvSub, NowTime, %DateCreated%, Days
  99.         IfInString, A_LoopField, SubDiv
  100.                 Continue
  101.        
  102.                 FormatTime, FolderName, %DateCreated%, yyyy
  103.        
  104.        
  105.         FileCreateDir %FolderName%
  106.         FileMove %A_LoopField%, %FolderName%
  107.         EverRun=1
  108. }
  109. Return
  110. }
  111.  
  112. UnderscoreSort()
  113. {
  114.         global
  115.         Loop PARSE, NewFiles, `n
  116.         {
  117.                 FileGetTime DateCreated, %A_LoopField%, C
  118.                 FormatTime, YearCreated, %DateCreated%, yyyy
  119.                 NowTime := SortTime
  120.                 EnvSub, NowTime, %DateCreated%, Days
  121.                 IfInString, A_LoopField, SubDiv
  122.                         Continue
  123.                
  124.                         FormatTime, FolderName, %DateCreated%, yyyy
  125.                
  126.                
  127.                 FileCreateDir %FolderName%
  128.                 FileMove %A_LoopField%, %FolderName%
  129.                 EverRun=1
  130.         }
  131.         Return
  132. }
  133.  
  134.  
  135. ShowSettings:
  136. Pause Off
  137. Gui, 3:Show, Center, Settings Dialog:
  138. Pause On
  139.  
  140. SendSettings:
  141.  
  142. Separator=%SeparatorSelection%
  143. Cleanup=%CleanupSetAt%
  144.  
  145.  
  146. if (RecurseSetAt = 1) and (RecurseWarning = 0)
  147. {
  148.         MsgBox, 4, Caution:, You have instructed SubDiv to sort all files in this folder, including files inside subfolders.`nDoing this will destroy the folder structures in the sorted directory.  Are you sure?
  149. RecurseWarning=1
  150.         IfMsgBox No
  151.                 GoSub ShowSettings
  152. }
  153.  
  154.  
  155. Recursive=%RecurseSetAt%
  156.  
  157. Gui, 3:Hide
  158. Gosub Start
  159.  
  160. Problems:
  161. MsgBox Unknown problems were encountered, but I can't say what...
  162.  
  163. 3GuiClose:
  164. return
  165. EndProg:
  166. 2GuiClose:

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: pyrohacker
« Reply #20 on: July 17, 2016, 11:31 PM »
Thanks for sharing your mods!  :up: