Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Convert Bitcoin prices to Google Correlate format
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
You can’t perform that action at this time.