Skip to content

Commit

Permalink
Merge pull request #3 from ProjectDebbie/develop
Browse files Browse the repository at this point in the history
version 2.0.2 split in folders
  • Loading branch information
javicorvi authored Nov 17, 2022
2 parents 292e608 + 8083cbd commit 1b6a11e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pubmed_timed_retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,17 @@ def fetch_details(webenv, querykey, retstart, retmax, outputfolder, ids_list, re
print ("Total abstracts in search query: " + str(count))
search_while=True
first_time = True
counter=1
while (retstart < count):
print ("Search from " + str(retstart) + " to " + str(retstart + retmax))
results = fetch_details(webenv, querykey, retstart, retmax, args.o, ids_list, args.r, reldate)
subfolder = args.o
#just in case there were more than 10000, the folder split starts
if(count>10000):
subfolder = args.o + "/abstracts_"+ str(counter)
if not os.path.exists(subfolder):
os.makedirs(subfolder)
results = fetch_details(webenv, querykey, retstart, retmax, subfolder, ids_list, args.r, reldate)
retstart=retstart+retmax
counter = counter + 1
print("Finish process")

0 comments on commit 1b6a11e

Please sign in to comment.