topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Sunday December 15, 2024, 3:25 pm
  • 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: Level - Copy files from various sources into one flat folder  (Read 19338 times)

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
babble
Inspired by this forum I have been getting to grips with AutoHotkey and my first product is a utility I wrote for my work here at Angus College to collect all the student/staff portraits in one central folder for use in our staff directory. We have 11 different folders across the network, and I was not sure where new pictures were added to, but always needed the latest updates to be available on the intranet. Anyway, I am sure it will be of some use to someone (and I am quite proud of it  :-[)

Levelcopies files from multiple sources into a flat folder. It can be invoked from the commandline. For every source you can specify a file filter, and currently therre are switches to include/exclude subfolders, whether or not you want to overwrite all files that already exist or only older ones. You can have unlimited sources (afaik) When you start it from explorer you see this:
level.pngLevel - Copy files from various sources into one flat folder
I can imagine that it would be handy to use to consolidate all your music from different pcs into one folder.

It requires cat.exe from UnxUtils because AutoHotkey doesn't allow you to send the output directly to the commandline. So if you want any output then put |cat at the end of a command. Instead you can also pipe it to a textfile.

level2.pngLevel - Copy files from various sources into one flat folder

for example:
level -oo -s c:\temp\1\*.* c:\temp\2\*.* d:\temp\output |cat
This would copy all never files from 2 sources on the c-drive into one destination folder in the d-drive, including subdirectories. However the output folder won't have any subdirectories (it's flat -- so if you have duplicate files, the newest version is always available)

Feel free to use it in any way or if you have suggestions they are welcome too.

Download Page
« Last Edit: March 05, 2009, 10:32 AM by justice »

PlayPhil

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 24
    • View Profile
    • Donate to Member
Re: Level - Copy files from various sources into one flat folder
« Reply #1 on: May 12, 2007, 06:39 AM »
Very nice util Justice. Ran a simple test, works as advertised, can't beat that :)

Thanks for the heads-up on the Unix/Win32 utils. Couldn't download from the site mentioned but Google quickly found a mirror in Germany where I could (seems to happen from time to time).

I'm thinking of writing a similar routine that would parse a tree & copy (or move) image files of a size, say 1024x768 into a flat folder, perhaps putting dups (1 of, in the case of several) in a subfolder in the case of moving.

Thanks for the outline  :Thmbsup:
Phil

xcopy

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 78
    • View Profile
    • Donate to Member
Re: Level - Copy files from various sources into one flat folder
« Reply #2 on: June 07, 2009, 11:53 PM »
This thread might be 2 years old but let me say anyway: level rocks!  :Thmbsup: :Thmbsup: :Thmbsup:
Thanks a lot justice!

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: Level - Copy files from various sources into one flat folder
« Reply #3 on: June 08, 2009, 05:20 AM »
Thanks xcopy much appreciated :) I still read it haha :) Maybe it's interesting to show how I use it:
At work I use a slightly different version (with progressbar and visual display of the last copied image) to copy a bunch of staff/student images from many different folders into the one folder so that they can be easily referenced from webpages. Ah it seems I said that in the babble.

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: Level - Copy files from various sources into one flat folder
« Reply #4 on: February 16, 2012, 02:43 AM »
If you want to play with the latest source, you can now fork from Bitbucket:
https://bitbucket.org/svandragt/level

I'll keep posting executable releases in this topic when they're available.

Hacnstein

  • Supporting Member
  • Joined in 2012
  • **
  • default avatar
  • Posts: 4
    • View Profile
    • Donate to Member
Re: Level - Copy files from various sources into one flat folder
« Reply #5 on: April 05, 2012, 09:10 PM »
there is a tool out there called levelzap from http://levelzap.codeplex.com/

IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 7,544
  • @Slartibartfarst
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Level - Copy files from various sources into one flat folder
« Reply #6 on: April 06, 2012, 08:39 AM »
I am a bit of a novice in this, and I might misunderstand what's required here, but after reading this discussion thread, I just now sat down with xplorer² to see whether I could meet the apparent requirements, and:
1. Created a Junction folder (Reparse point).
2. Created a scrap pane (a sort of virtual folder).
3. Selected several folders and flattened them and their contents into the scrap pane, creating a flat file (you could save this for future use as a reusable CIDA file - a particularly useful/powerful feature in xplorer²).
4. Copied all files in the scrap pane.
5. Pasted them into the Junction folder (I think this this effectively creates a "Library" containing pointers to all the files pasted).
This reproduced the flat file structure in the Junction folder.
The above steps should apply for Win XP and Win7-64bit Home Premium.

I then:
1. Created a new Library in Windows Explorer.
- then performed steps 2, 3, 4 above in xplorer².
5. Using Windows Explorer, pasted them into the Library folder (I think this effectively creates a "Library" containing pointers to all the files pasted).
This reproduced the flat file structure in the Library.
The above steps should apply for Win7-64bit Home Premium.

I could be wrong, of course, but I think this means that:
(a) You could then access the Reparse point folder or Win7 Library as your central (consolidated) server "directory".
(b) This directory would reflect realtime any changes to the source folders/files included in the flattened file.
(c) You do not need to copy any actual files anywhere to create the central (consolidated) server "directory".

The main constraints here I think would be:
  • You can only do this in NTFS formatted file systems/drives.
  • The Reparse points can not be created to work across a network, so you would need to have it all on a single server with directly attached drives - and of course, the web site will be able to access the central (consolidated) server "directory". I am unsure whether this constraint applies to Win7 "Libraries", but I would expect it probably does.

I have been experimenting using this approach to create a structured (not a flat file) central (consolidated) "directory" to hold all of the target folders to go into my FreeFileSync backup. This is instead of the conventional and rather tedious approach of individually specifying in FFS which target folders to back up. So FFS would just back up whatever was in the central (consolidated) "directory", and I could change the contents of that directory to manage backups of changes to the range of backup target files/folders.

Caveat:
  • Mucking about with Junction folders (Reparse points) could be risky if you are not careful with your file-naming (I always include the word "Junction" in a Reparse point folder name).
  • Anything you do to a logical folder or file in a Junction folder directly affects the actual folder or file on disk.

Hope this all makes sense and is of use/help to someone.     :)