Skip to content

Instantly share code, notes, and snippets.

@yjzhang
Created February 1, 2019 23:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yjzhang/ae4086282748cd42ba597f50b0150d00 to your computer and use it in GitHub Desktop.
Save yjzhang/ae4086282748cd42ba597f50b0150d00 to your computer and use it in GitHub Desktop.
Download all medline citations from ncbi
#!/bin/bash
# downloads all MEDLINE/Pubmed citations in the annual baseline.
for i in $(seq 1 972); do
fname="1"
if ((i < 10)); then
fname="ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed19n000$i.xml.gz"
elif ((i < 100)); then
fname="ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed19n00$i.xml.gz"
elif ((i < 1000)); then
fname="ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed19n0$i.xml.gz"
fi
echo $fname;
wget $fname;
sleep 2;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment