Created
February 1, 2019 23:01
-
-
Save yjzhang/ae4086282748cd42ba597f50b0150d00 to your computer and use it in GitHub Desktop.
Download all medline citations from ncbi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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