Flat File Management - attempt #2 - v1.2

Discuss and share scripts and script files...
Post Reply
Posts: 1414
Joined: 04 Nov 2008 05:35
Location: Hanoi, Vietnam

Flat File Management - attempt #2 - v1.2

Post by binocular222 »

Following my previous attempts here:
Flat File Management - attempt #1 http://www.xyplorer.com/xyfc/viewtopic. ... ent#p94487
Collection Manager http://www.xyplorer.com/xyfc/viewtopic.php?f=7&t=10231
Knowledge Management http://www.xyplorer.com/xyfc/viewtopic.php?f=11&t=10221
Here is the 2nd attempt (much better):
Flat File Management
v1.0 - 9-Nov-13 - Initial release
v1.1 - 10-Nov-13 - remove redudant cell in FavTag + Bug fix
v1.2 - 13-Nov-13
Rely on Quick Name Search instead of Visual Filter
Add a bunch of options in the bottom of HTML table
See above links to know why sometime folders are bad and we should store files in 1 place with no child folder and navigate by "tag"
Step 1: Choose which collection to flatten
Not everything should be flatten. Folder structure can be effective at storing data which is very distinguishable. example:
Tax Advisory\Client A\Expense\*.*
Tax Advisory\Client A\Revenue\*.*
Tax Advisory\Client B\*.*

You only flatten collection of data which have no clear relationship such as collection of movies/pictures/articles.
Step 2: Name files with pattern: Name ~ Tag1, Tag2, Tag3,
Name portion and Tag portion is separated by ~
Each Tag is surrounded by a space in the beginning and a comma in the end
Name must reflect the identity of file's content. i.e: "Inside - Tropfest Australia 2013 Finalist (Tsi -Balloon-).mp4" should be rename to "Inside ~ Tropfest, Australia, 2013, Finalist, TSI-Balloon, Drama,.mp4" because the title of the movie is "Inside". Notice that I breakdown the Tag Portion as small as possible. (I will update more about file naming convention in a separate attachment in this post)
Step 3: Run the script
St1.png (82.97 KiB) Viewed 2812 times
It read all file names in current List and list out all Tags then summary in a HTML table:
- Number of occurence (sorted Large to small)
- Tag name
- 5 actions that user can click on:
+ Add, Remove will Add or Remove that Tag from selected items
+ 3 kind of Visual Filter to choose from
Now, scroll down to the bottom of table is 2 sections:
St2.png (26.55 KiB) Viewed 2768 times
Section1: 6 options are presented in 1 line:
- ClearCache, LoadCache: If your collection is too large making the script slow, you can add cache location by editing the $g_Cache1Path, $g_Cache2Path, $g_Cache3Path in the script. Everythime you run the script in one of these location, cache is saved in Permanent Variable and can be Load and Clear Cache accordingly
- SaveFav = Save current Visual Filter into FavTag.txt in current folder location. The next time you run the script, this favourite is added to the beginning of the table. In below screenshot, I added 2 Favourite. Clicking on the respective name in column 1 will lauch the filter. Column 2 is the word Del, means Delete this Favourite.
- FixTag: correct double space, empty tag, tags with no comma in the end...
besides if you already define Parent-Child tag relationship in FavTag.txt, then if selected file has Child Tag, then Parent Tag is removed to avoid overlong file name
- Notag: Search for untagged items
Section 2:
if you already define Parent-Child tag relationship in FavTag.txt, then they are listed here. On click will search for Parent OR Child

FavTag.txt has this structure:

Code: Select all

Favourite search
st3.png (21.88 KiB) Viewed 2781 times
v1.2 - 13-Nov-13
(19.59 KiB) Downloaded 379 times
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

Post Reply