Question: Sleep or delay for batching EDirect search
0
gravatar for agcresearchactivities
4 months ago by
agcresearchactivities0 wrote:

Hi,

I am new to any programming so I think I have a relative simple problem.

I am trying to automate performing multiple searches from pubmed through Edirect by inputing a file that contains different search terms on each line that outputs to a text file. The formula below works when the input file only has a few search terms, but I get timed out when I have a file with more search terms. I think I need to put a "sleep" parameter somewhere to slow down the query, but can't quite figure out where.

IFS=$'\n'; for next in $(cat testsearch.txt) ; do esearch -db pubmed -query $next  >>output.txt ;done

Thanks! Ana

pubmed edirect • 192 views
ADD COMMENTlink written 4 months ago by agcresearchactivities0

How about

IFS=$'\n'; for next in $(cat testsearch.txt) ; do esearch -db pubmed -query $next  >>output.txt; sleep 60 ;done
ADD REPLYlink written 4 months ago by genomax51k

I think esearch has a batch mode as well off the top of my head, so you may be able to pass it your file of search terms directly (been a while since I played with it though). I don't imagine it'll alter the time out issue though - more FYI.

ADD REPLYlink written 4 months ago by jrj.healey4.8k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1486 users visited in the last hour