--- /dev/null
+convert = function(orig_csv_file, nb_series_per_chunk)
+{
+ orig_file = file(orig_csv_file, open="r")
+ ignored = readLines(orig_file, 1) #skip header
+
+ serie_length = 17520 #365*24*2
+ library(sqldf, quietly=TRUE)
+ ids = read.csv.sql(file_csv, header = TRUE, sep = ","
+ sql = "select * from file_csv group by FK_CCU_ID")
+ index = 0
+ repeat
+ {
+ if (index+1 >= length(ids))
+ break
+ request = "select CPP_DATE_PUISSANCE,CPP_PUISSANCE_BRUTE where FK_CCU_ID in ("
+ for (id in ids[index + seq_len(nb_series_per_chunk)])
+ request = paste(request, id, ",", sep="")
+ request = paste(request, ") order by FK_CCU_ID,CPP_DATE_PUISSANCE", sep="")
+ series_chunk = read.csv.sql(file_csv, header = TRUE, sep = ",", sql = request)
+
+ index = index + 17520