Moving/Filtering JPEG files?

This is a discussion on Moving/Filtering JPEG files? within the Windows Programming forums, part of the Platform Specific Boards category; I have 64,000 JPEG images of sheetmusic in a directory, and I want to pull approximately 18,000 of them out ...

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    3

    Moving/Filtering JPEG files?

    I have 64,000 JPEG images of sheetmusic in a directory, and I want to pull approximately 18,000 of them out [All of the Vocal ones]. I have a list of the filenames that I want to keep. How do I get my pc to do this filter without me having to move them by hand?

    Your response is greatly apppreciated.
    Aaron Buckley
    aaron@vocalsource.com

  2. #2
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    What are the file names? If they are regular and consistent, it should be a piece of cake.
    benforbes@optusnet.com.au
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Put the file names that you want to keep in an array...

    Use this array in a loop with FindFirstFile & FindNextFile....MoveFile to put the good files in another folder..then use FindFirstFile & FindNextFile again in the original folder, but use wildcards (*.*).....for each file call DeleteFile on all remaining files in the folder...then RemoveDirectory to finish the job

  4. #4
    Registered User
    Join Date
    Jan 2003
    Posts
    3

    The file names are numerical

    The file names are in an access database right now, and are mostly 8 digit numbers like this:
    50428991
    50428220
    50428221
    50428300
    etc...

    Then the image files are all named that number .JPG like this:
    50428991.JPG
    50428993.JPG
    50428994.JPG
    50428999.JPG
    50428210.JPG
    50428215.JPG
    50428220.JPG
    50428221.JPG
    50428250.JPG
    50428251.JPG
    50428300.JPG
    etc...

  5. #5
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    Yeah, but what is the difference between the ones you want and the ones you don't want?
    benforbes@optusnet.com.au
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

  6. #6
    Registered User
    Join Date
    Jan 2003
    Posts
    3
    The ones that I want to keep are the ones that match up to all of the items in our database.


    It is for a vocal sheet music website. I've got a database of 64,000 Hal Leonard sheet music books, and a directory with 64,000 images. I've got the database pared down to just the 18,000 Vocal titles, and it is ready to be loaded onto our website. The problem is that I can't load all 64,000 images without smashing through my account's total disk space of just 300MB. If I could pare them down to just the 18,000 Vocal ones that I need, then I could let the web browsing public search our database with images matched up to every item.

    If I have all of the extra images, then it will take up 821MB of server space, verses 230MB of space if I remove the ones that we aren't using.

  7. #7
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    Well, I'm no expert on file operations, but if I was, I would obtain a directory listing in the form of an array, and one by one sort through the list, checking each item against your database. If there is a match, move the item to another directory, and delete the item from both the array and the database (create a temporary database).
    benforbes@optusnet.com.au
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reading .dat files from a folder in current directory...
    By porsche911nfs in forum C++ Programming
    Replies: 7
    Last Post: 04-04-2009, 10:52 PM
  2. Linking header files, Source files and main program(Accel. C++)
    By Daniel Primed in forum C++ Programming
    Replies: 3
    Last Post: 01-17-2006, 11:46 AM
  3. Multiple Cpp Files
    By w4ck0z in forum C++ Programming
    Replies: 5
    Last Post: 11-14-2005, 02:41 PM
  4. Folding@Home Cboard team?
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 398
    Last Post: 10-11-2005, 09:44 AM
  5. Batch file programming
    By year2038bug in forum Tech Board
    Replies: 10
    Last Post: 09-05-2005, 04:30 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21