Using the with cURL command-line tool on Mac, What can I do to this script to ask it to fetch stock data which comes back WITHOUT commas?
cd documents/quoteUpdate
while true
do
curl -o quotes.txt -s "http://download.finance.yahoo.com/d/quotes.csv?s=goog,aapl&f=sl1c1p2pt1"
echo UPDATED:
date
sleep 10
done
You could use sed
to edit quotes.txt. This example changes all commas to a space character (s/,/ /g). A backup of the original file is named quotes.txt.bak.
cd documents/quoteUpdate
while true
do
curl -o quotes.txt -s "http://download.finance.yahoo.com/d/quotes.csv?s=goog,aapl&f=sl1c1p2pt1"
sed -i '.bak' 's/,/ /g' quotes.txt # replace commas with spaces
echo UPDATED:
date
sleep 10
done