DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Help With A Solution?  (Read 9,713 times)

y0himba

  • Yar.
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 448
    • Military Service Badge - US Army
    • Military Service Badge - US Navy
Help With A Solution?
« on: October 25, 2012, 11:41 AM »
I have an issue that is beyond my batch script capabilities.  OS is Windows (hold the snark).  I have a folder structure like this:

I:\WELLS HARDRIVE
|-######(random numbered folder)
  |-######(random numbered folder)
Usually about 30-50 more sub folders, each of those folders containing TIF files with standardized pattern names. four leading digits, a six digit account number, an underscore, then 3 trailing digits. ##########_###.tif  These files, literally hundreds of thousands of them in 480 directories each with 30+ sub directories and over a thousand images in those directories, need to be moved to another directory down the tree.  The directories are already created and contain a 3 digit prefix (430) then the 6 digit account number found in the middle of the TIF file name.  So we have a file named 1230123456_789.tif, then the directory it needs to be moved to is I:\WELLS HARDRIVE\BSI\430123456. They are on a networked drive mapped in Windows to the I: drive. The directory they need to be moved to is:

I:\WELLS HARDRIVE
|-BSI
 |-430######

I need a batch way (file, program) to read the file names for that 6 digit account number, then copy or move those file to the corresponding location under BSI, into the corresponding numbered directory.  If not, I am going to be sitting here all day just searching *.tif and manually moving them...it'll take days if not a couple of weeks.


HELP?!

There is DC credits in it for anyone when I get paid on November 15th.

Did I mention I love you all?  :-*

Renegade

  • Tell me something you don't know...
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,291
    • Participated in NANY Challenge Three Times
    • Furry Fandom Badge - Furry Fandom
    • Linux User
Re: Help With A Solution?
« Reply #1 on: October 25, 2012, 12:23 PM »
Sounds like a very fun problem to solve! :)

Unfortunately, I don't have the time at the moment. I'm just goofing off (surfing DC when I should be polishing a presentation script), and I know that for me to get it done and properly tested is more time than I have.

However, you might want to search for "move files with regular expression". I had a quick look there, and the problem looks to be fairly common. You might find an answer that exactly fits what you need.

I think a trouble spot might be in file vs. path. Not sure exactly though. But it's one thing to watch.
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Help With A Solution?
« Reply #2 on: October 25, 2012, 01:43 PM »
This sounds like something DC member skwire codes up in his sleep in the Coding Snacks section..

Suggestion: Don't work on or use any tool that "MOVES" them, too much risk of messing up your data.
Just have it COPY them and then delete the old ones only after you are 100% sure it did what you wanted.

y0himba

  • Yar.
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 448
    • Military Service Badge - US Army
    • Military Service Badge - US Navy
Re: Help With A Solution?
« Reply #3 on: October 25, 2012, 05:33 PM »
I was thinking of a simple batch file, since it is Windows.  I would then need to talk to the IT department, see if I could get them off Reddit long enough to run the batch on the back end.  I honestly just don't have the time to teach myself right now.  There are literally Terabytes of queued data to be processed...

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: Help With A Solution?
« Reply #4 on: October 25, 2012, 06:31 PM »
My File Punter application should be able to do this.  y0himba, do you have any experience with regular expressions?

y0himba

  • Yar.
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 448
    • Military Service Badge - US Army
    • Military Service Badge - US Navy
Re: Help With A Solution?
« Reply #5 on: October 25, 2012, 06:32 PM »
My File Punter application should be able to do this.  y0himba, do you have any experience with regular expressions?

Unfortunately, no.  Another issue I am running into is a less then helpful IT department.  I think I may need to create the file then try to somehow get them to run it on the back end.

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: Help With A Solution?
« Reply #6 on: October 25, 2012, 06:37 PM »
Unfortunately, no.

No worries, this should be a simple operation.

Another issue I am running into is a less then helpful IT department.  I think I may need to create the file then try to somehow get them to run it on the back end.

Hmmm...do you not have direct access to these folders?  That is, are you not able to manipulate them yourself from your computer?

BTW, I'm trying to raise you via PM on IRC...might be easier than going back and forth on the forum.

y0himba

  • Yar.
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 448
    • Military Service Badge - US Army
    • Military Service Badge - US Navy
Re: Help With A Solution?
« Reply #7 on: October 26, 2012, 12:29 AM »
HOLY CRAP!  File Punter is AMAZING.  I tried a few others similar, but nothing was as powerful or flexible. The folks at work have been trying to process 600000+ files for 3 week, and with Skwire's help I was able to get it done TODAY. Regular Expression is INCREDIBLE!

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: Help With A Solution?
« Reply #8 on: October 26, 2012, 12:33 AM »
Right on.  Thanks for the update.  :D

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Help With A Solution?
« Reply #9 on: October 26, 2012, 12:40 AM »
Nice  :Thmbsup:
I love reading threads like this.

TaoPhoenix

  • 0 - 60 ... then back to 0 again!
  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 4,642
    • Participated in NANY Challenge Three Times
Re: Help With A Solution?
« Reply #10 on: October 26, 2012, 02:05 AM »
HOLY CRAP!  File Punter is AMAZING.  I tried a few others similar, but nothing was as powerful or flexible. The folks at work have been trying to process 600000+ files for 3 week, and with Skwire's help I was able to get it done TODAY. Regular Expression is INCREDIBLE!

"And you told them how long it really took you? Couldn't you have used a week to finish all the other crap that management overloaded you with?"  :P  (Paraphrasing Scotty from Trek in TNG Relics talking to Geordi La Forge)
Use attachthumb=# to show an attached image as an expandable thumbnail, or attach=# to show full size. (With Brackets)

Original address: https://www.donationcoder.com/forum/index.php?topic=32651.0