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 6912969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:09:29+00:00 2026-05-27T09:09:29+00:00

I have 700 files in a single folder. I need to find files that

  • 0

I have 700 files in a single folder. I need to find files that have “h10v03” as part of the name and copy them to a different folder using python.

Heres an example of one of the files: MOD10A1.A2000121.h10v03.005.2007172062725.hdf

I appreciate any help.

  • 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-05-27T09:09:30+00:00Added an answer on May 27, 2026 at 9:09 am

    Does it need to be python?
    A unix shell does that for you quite fine:

    cp ./*h10v03* /other/directory/
    

    In python I would suggest you take a look at os.listdir() and shutil.copy()

    EDIT:
    some untested code:

    import os
    import shutil
    
    src_dir = "/some/path/"
    target_dir = "/some/other/path/"
    searchstring = "h10v03"
    
    for f in os.listdir(src_dir):
       if searchstring in f and os.path.isfile(os.path.join(src_dir, f)):
          shutil.copy2(os.path.join(src_dir, f), target_dir)
          print "COPY", f
    

    with the glob module (untested):

    import glob
    import os
    import shutil
    
    for f in glob.glob("/some/path/*2000*h10v03*"):
       print f
       shutil.copy2(f, os.path.join("/some/target/dir/", os.path.basename(f)))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have about 2200 different files in a few different folders, and I need
I have a folder with about 1,700 files. They are all named like 1.txt
I have a data set that is around 700 rows with eight columns of
I have an application that creates trees of nodes, then tosses them and makes
I need the following alignment For that I have created the xaml file as
I have a PERL script that is creating a lot of sockets (around 700
I have very large datasets that are stored in binary files on the hard
I have a Git project that it's a bit special because the files in
I have an excel spreadsheet with about 700 entries. The names are listed as
I have a SQL script which is extremely large (about 700 megabytes). I am

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.