@echo off

if exist data.csv del data.csv

for /F %%i in (symbols.txt) do (

    gsqlcmd convert "https://query1.finance.yahoo.com/v7/finance/chart/%%i?range=1d&interval=1m&indicators=quote&includeTimestamps=true" ^
            csv\data.csv /append "/datetimeformat=yyyy-MM-dd HH:mm:ss" /add=Symbol=%%i /echoUrl
    
    gsqlcmd sleep 300
)

if .%1.==./Q. goto :EOF

start csv

@pause
