Page 1 of 1

I see more than one file types downloaded when using script

PostPosted: Fri Nov 20, 2020 7:58 am
by sureshsksv
In the SAFE package for some collections, we get more than one data types. The script was setup to make sure the team is not missing out any file we got as part of the SAFE package.

To select only specific files the code snippets below has been

downloads = [item for sublist in downloads_all for item in sublist]
filter_files = ['.nc', '.dat','.bin'] # This will only download netcdf, data, and binary files, you can add/remove other data types as you see fit
import re
def Filter(list1, list2):
return [n for n in list1 if
any(m in n for m in list2)]