Search code examples
apachedownloadwebserverfedora

trying to download a dataset from a website


I am trying to download a dataset from a website but I can't download the whole folder .. I have to download each file separately which will need a lot of time. I am wondering if there is anyway to download the whole folder at a time??

The website link: http://www.physionet.org/pn4/eegmmidb/


Solution

  • These two for cycles run in bash should do it:

    for S in S{001..109}; do
       mkdir ${S}
       cd ${S}
       for R in R{01..14}; do
          file="http://www.physionet.org/pn4/eegmmidb/${S}/${S}${R}.edf"
          wget "$file"
          wget "${file}.event"
       done
       cd ..
    done