Created
June 6, 2019 21:32
-
-
Save MrJeremyHobbs/184f47b92820a1d598fff0a2ccd406a3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/usr/python3 | |
| import glob | |
| import shutil | |
| # get list of all MRC files in Downloads folder | |
| files = glob.glob("c:\\users\\jthobbs\\downloads\\*.mrc") | |
| # generate combined MARC file | |
| with open('c:\\users\\jthobbs\\Desktop\\KANOPY_RECORDS.mrc','wb') as wfd: | |
| for f in files: | |
| with open(f,'rb') as fd: | |
| shutil.copyfileobj(fd, wfd, 1024*1024*10) | |
| #10MB per writing chunk to avoid reading big file into memory. | |
| # finish | |
| print("Done.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment