]> Creatis software - bbtk.git/commitdiff
2110 Bug Probleme reading the las line of the file : Read Columns box
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Mon, 19 Aug 2013 13:47:05 +0000 (15:47 +0200)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Mon, 19 Aug 2013 13:47:05 +0000 (15:47 +0200)
packages/std/src/bbstdReadColumnsDouble.cxx
packages/std/src/bbstdReadColumnsInt.cxx
packages/std/src/bbstdReadColumnsString.cxx

index c74a39fd1ff6e68a03059648200135ad841ce4b2..915990fff6698874e7d91732aa4ec33d298655a6 100644 (file)
@@ -51,7 +51,7 @@ void ReadColumnsDouble::Process()
        }       
        
        int numberOfLines = 0;
-       char tmpValue[50];
+       char tmpValue[1000];
        std::vector<double> *vecData;
        FILE *ff1 = fopen( bbGetInputFileName().c_str() , "r+" );
        if (ff1!=NULL)
index ec1452b70c32fc528c37a9a63e664de831c936a4..2d5443f815211ef42927d31d699b83fcc3e3c2ca 100644 (file)
@@ -51,18 +51,21 @@ void ReadColumnsInt::Process()
        }       
        
        int numberOfLines = 0;
-       char tmpValue[50];
+       char tmpValue[1000];
        std::vector<int> *vecData;
        FILE *ff1 = fopen( bbGetInputFileName().c_str() , "r+" );
        if (ff1!=NULL)
        {
+                if (!feof(ff1))
+                        fscanf(ff1,"%s",tmpValue);
+
                while (!feof(ff1))
                {
                        for( i=0 ;  i<bbGetInputDimension() ; i++)
                        {
-                               fscanf(ff1,"%s",tmpValue);
                                vecData=tlst[i];
                                vecData->push_back( atoi(tmpValue) );
+                               fscanf(ff1,"%s",tmpValue);
                        }       
                        numberOfLines++;                        
                }       
index 63c14c79711072ed968c9701cb9be97b8203ebe1..6d9cfe5f3c37b055e60f7449ff3b18648660deb7 100644 (file)
@@ -70,7 +70,6 @@ void ReadColumnsString::Process()
                                fscanf(ff1,"%s ",tmpValue);
                                vecData=tlst[i];
                                vecData->push_back( tmpValue );
-                                       printf("*******************************************EC ReadColumnsString::Last Value: %s \n",tmpValue);
                        }       
                        numberOfLines++;                        
                }