Skip to content

Instantly share code, notes, and snippets.

@karthikeyann
Created January 31, 2019 20:16
Show Gist options
  • Save karthikeyann/93be42bc2c301342ade540717d6e715c to your computer and use it in GitHub Desktop.
Save karthikeyann/93be42bc2c301342ade540717d6e715c to your computer and use it in GitHub Desktop.
EOD EQUITIES data from NSE website (get all bhavcopy files of the year)
#!bash
YEAR=2018
for MONTH in JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC
do
for d in {1..31}
do
foo=$(printf "%02d" $d)
curl -O "https://www.nseindia.com/content/historical/EQUITIES/${YEAR}/${MONTH}/cm${foo}${MONTH}${YEAR}bhav.csv.zip"
done
done
find . -name "*.csv.zip" -size -2k -delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment