X-Git-Url: https://git.auder.net/?p=epclust.git;a=blobdiff_plain;f=data%2Fpreprocessing%2Fconvert_to_CSV.c;fp=data%2Fpreprocessing%2Fconvert_to_CSV.c;h=df31f7154a05b2ab9e9d8c337613f402adea0a32;hp=34cb6e453adc10205e89a87099600b5f13f40984;hb=2203730448baaaaa6164729fb1db9cca7a488872;hpb=f3eb8aafde095a0f4f7b429c96e9da6cead14ea8 diff --git a/data/preprocessing/convert_to_CSV.c b/data/preprocessing/convert_to_CSV.c index 34cb6e4..df31f71 100644 --- a/data/preprocessing/convert_to_CSV.c +++ b/data/preprocessing/convert_to_CSV.c @@ -4,6 +4,7 @@ #include #include #include +#include // Read an integer char by char, and position the cursor to next character char readInt(FILE* stream, int* integer) @@ -15,8 +16,13 @@ char readInt(FILE* stream, int* integer) nextChar = fgetc(stream); ungetc(nextChar, stream); while ((nextChar = fgetc(stream)) >= '0' && nextChar <= '9') - *integer = 10 * (*integer) + (int) (nextChar - '0'); + { + + printf("next char: %c\n",nextChar); + + *integer = 10 * (*integer) + (int) (nextChar - '0'); } (*integer) *= sign; +printf("INTEGER: %i\n",*integer); return nextChar; } @@ -113,13 +119,13 @@ int transform(const char* ifileName, int posID, int posValue, // Read current line scan_line(ifile, sep, posID, &ID, posValue, &value); + + printf("SCAN: %i %g\n",ID,value); if (ID != lastID) { // Just starting a new time-series: must process the last one (if exists !) if (lastID > 0) { - if (refTsLength == 0) - refTsLength = tsLength; //first serie is considered clean if (tsLength == refTsLength) { for (int i=0; i