Created
September 29, 2011 17:59
-
-
Save ripper234/1251429 to your computer and use it in GitHub Desktop.
Convert Bitcoin prices to Google Correlate format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Date; | |
String lastDateStr = null; | |
new File('trades.csv').eachLine({ | |
def columns = it.split(',') | |
def date = new Date(columns[0].toLong() * 1000) | |
String dateStr = (1900 + date.getYear()) + "-" + (date.getMonth() + 1) + "-" + date.getDate() ; | |
if (dateStr != lastDateStr) { | |
lastDateStr = dateStr; | |
println dateStr + ", " + columns[1] | |
// System.exit(0); | |
} | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment