diff --git a/insertDataBitcoin.sh b/insertDataBitcoin.sh new file mode 100755 index 0000000000000000000000000000000000000000..6b5b81104cd5b666c57c23ee97a165cfda4fe305 --- /dev/null +++ b/insertDataBitcoin.sh @@ -0,0 +1,45 @@ +#! /usr/bin/bash + + +dateTime=$( ./bitCoinTracker.sh | cut -d':' -f 1 --complement | head -n 1) +echo "$dateTime" + + +#to add data into database by matching the pattern +awk -F':' '{ + +if(/BitCoin Value/){ + print $2 + +}else if(/BitCoin 24 Hour Low/){ + print $2 + +}else if(/BitCoin 24 Hour High/){ + print $2 + +}else if(/BitCoin 24 Hour Open/){ + print $2 + +}else if(/BitCoin Market Cap/){ + print $2 + +}else if(/BitCoin Change In Value/){ + print $2 + +}else if(/BitCoin Return Percentage/){ + print $2 + +}else if(/BitCoin Volatility/){ + print $2 + +}else if(/BitCoin 24 H Transaction Count/){ + print $2 + +}else if(/BitCoin Transaction Fee/){ + print $2 + +} + +}' < /dev/stdin + +