我想在一个充满字符串的列表中找到一个特定的条目。例如,我想查找所有包含数字“.0130”的字符串。(像下面的第三行)该文件如下所示:https://ladsweb.modaps.eosdis.nasa.gov/archive/allData/6/MYD021KM/2018/001/MYD021KM.A2018001.0140.006.2018002030901.hdfhttps://ladsweb.modaps.eosdis.nasa.gov/archive/allData/6/MYD021KM/2018/001/MYD021KM.A2018001.0135.006.2018002030858.hdfhttps://ladsweb.modaps.eosdis.nasa.gov/archive/allData/6/MYD021KM/2018/001/MYD021KM.A2018001.0130.006.2018002030850.hdfhttps://ladsweb.modaps.eosdis.nasa.gov/archive/allData/6/MYD021KM/2018/001/MYD021KM.A2018001.0125.006.2018002030903.hdf我像这样阅读文件:data_links = []f=open(workdir1+"/download.txt", "r")for i in f: data_links.append(i.rstrip())f.close()如何查找包含“.0130.”部分的所有条目?
添加回答
举报
0/150
提交
取消