From 47b5f92039922de13e74fa66dbd0df052cc5fad5 Mon Sep 17 00:00:00 2001
From: Mohcine Chraibi <m.chraibi@fz-juelich.de>
Date: Fri, 15 Mar 2019 19:04:58 +0100
Subject: [PATCH] split considering several spaces

---
 src/SaxParser.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/SaxParser.cpp b/src/SaxParser.cpp
index d4b01ee..c1aef78 100644
--- a/src/SaxParser.cpp
+++ b/src/SaxParser.cpp
@@ -1314,8 +1314,6 @@ bool SaxParser::ParseTxtFormat(const QString &fileName, SyncData* dataset, doubl
                else
                     qDebug()<<"INFo: frame rate: "<<*fps<<endl; //exit(0);
           }
-          // skip header
-          in.readLine();
           line = in.readLine();
           int maxFrame=1000;
           if(line.split(":").size()==2)
@@ -1329,6 +1327,9 @@ bool SaxParser::ParseTxtFormat(const QString &fileName, SyncData* dataset, doubl
                else
                     qDebug()<<"INFO: max frame: "<<maxFrame<<endl; //exit(0);
           }
+          // skip header
+          in.readLine();
+
           //initialize the process dialog
           QProgressDialog progressDialog ("Simulation","Abbrechen",1, maxFrame,NULL);
           progressDialog.setModal(true);
@@ -1347,7 +1348,7 @@ bool SaxParser::ParseTxtFormat(const QString &fileName, SyncData* dataset, doubl
           while ( !in.atEnd() )
           {
                QString line = in.readLine();
-               QStringList pieces = line.split(QRegExp("\\s"));
+               QStringList pieces = line.split(QRegExp("\\s+"));
 
                double pos[3];
                double angle[3]={0,0,30};
-- 
GitLab