Sign in with
Sign up | Sign in
Your question
Solved

Pulling list of files from a directory

Tags:
  • Mac OS X
  • Programming
  • External Hard Drive
Last response: in Mac Os X
Share
October 23, 2013 7:22:04 AM

Hi!

I have a folder with about five thousand PDF files on an external hard drive. They're all cleanly named by an identifying number, so they're easy to find and all that.

The thing is, on a weekly basis I have to pull a selection of about 500 of them to send elsewhere. I have an excel list of all of their identifying numbers, so right now all I know to do is just search for each number in turn, and save a copy of that file to a folder on my desktop. Then repeat this 500 times.

The complication is that about 20% of the files on my list will not be in my big directory, they're in some other location and I'll have to go hunting after them.

Would any of you folks know of a way to automate this somehow? Ideally, I would feed in a list of file names, and get all the available files pulled from my external drive and copied into a temporary location. But I would need to be able to see which files were not found in the big directory, so that I can go looking for them manually.

I am not super smart about computers, but I can follow directions well.

Thanks in advance!

More about : pulling list files directory

October 23, 2013 7:40:28 AM

Yes; you can write a simple script to do that. Almost any language will do. Even a shell script will work. Like in Perl, Python, bash/zsh (any shell script), Java, C, etc. I personally think shell or Perl would be the two easiest to use just because it takes very little lines of code. Python, maybe, but I've never fancy its os library.
m
0
l

Best solution

October 23, 2013 7:41:47 AM

If you know someone who is, or was, 'DOS' (WinNT Command Line) savvy they can use something like:

DIR /A /S /B
DIR /B (for bare)
DIR /A (includes hidden, standard format)
DIR /S (includes sub-directories, and their sub-directories, and so on up to the max command path depth).


If you would like a graphical solution, that does everything you want (as above), since I know some C# .NET I could code something up for you for a small fee (as a hobby project, we're talking under $250 here).
Share
Related resources
!