Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8060009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:50:52+00:00 2026-06-05T09:50:52+00:00

I have a folder with around 200,000 jpeg images. Below are the format of

  • 0

I have a folder with around 200,000 jpeg images. Below are the format of fileNames I can find

  1. BATCHID_GROUPID ex: 501234_20123.jpg
  2. BATCHID_GROUPID ex. 501235_20124_1.jpg, 501235_20124_2.jpg, 501235_20124_3.jpg. Each of this type images will have max of 10 images of BATCHID_GROUPID. What I mean is for this set the max will be 501235_20124_10.jpg

I need to take all the images that don’t end with _x or _xx i.e _1.jpg or _2.jpg or _10.jpg and pick the BATCHID and copy it and FTP it to a different location

For the ones that end with _x or _xx I need to pick BATCHID and create a folder with the name as batchID and move all the files that end with _X to _xx into the folder.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T09:50:54+00:00Added an answer on June 5, 2026 at 9:50 am

    Try using String.Split on your files names, check for length to determine where you are going to copy it and take the first index as your BATCHID:

    Something like this:

    DirectoryInfo di = new DirectoryInfo("SourcePath");
    IEnumerable<FileInfo> fileinfo = di.EnumerateFiles();
    foreach(FileInfo fi in fileinfo)
    {
        string[] tmp = fi.Name.Split('_');
        if (tmp.Length == 3)
        {
            if (!Directory.Exists("YourPath"))
            {
                Directory.CreateDirectory("YourPath" + tmp[0].ToString());
                fi.MoveTo("YourPath" + tmp[0].ToString() + @"\" + fi.Name);
    
            }
            else
                fi.MoveTo("YourPath" + + tmp[0].ToString() + @"\" + fi.Name);
    
        }
        else if (tmp.Length == 2)
        {
            //Copy Batch Id and Ftp logic
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My question I have folder contains the images in mat format how I can
I've searched around but I can't find my issue. I have a simple script
I have a folder in windows/Linux which has below files test_1a.play test_1AA.play test_1aaa.play test-_1AAAA.play
I have a folder with 320G images, I want to move the images to
I have found this script scattered around my Wordpress uploads folder on my shared
I have some images floating around in my SWF. The SWF holds several buttons,
I have looked around to find out where to save general text files for
I have a file that has over 200 lines in this format: name old_id
I am running centos and I have around 1,300 files in a folder that
I have some directories containing test data, typically over 200,000 small (~4k) files per

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.