Index: src/datacreator.cpp
===================================================================
--- src/datacreator.cpp	(revision 4aa03a552cf306f8b3265e786d08e545bf01bed4)
+++ src/datacreator.cpp	(revision fb936468428f5110b9922aa5f20ccb14c1c45e08)
@@ -520,11 +520,13 @@
 void AbsEnergyPlotLine(ofstream &output, class MatrixContainer &Energy, const char *prefix, const char *xargument, const char *uses)
 {
-  char item[1024];
   stringstream line(Energy.Header);
-
-  line >> item;
+  string token;
+
+  getline(line, token, '\t');
   for (int i=2; i<= Energy.ColumnCounter;i++) {
-    line >> item;
-    output << "'" << prefix << ".dat' title '" << item << "' using " << xargument << ":(abs($" << i+2 << ")) " << uses;
+    getline(line, token, '\t');
+    while (token[0] == ' ') // remove leading white spaces
+      token.erase(0,1);
+    output << "'" << prefix << ".dat' title '" << token << "' using " << xargument << ":(abs($" << i+2 << ")) " << uses;
     if (i != (Energy.ColumnCounter))
       output << ", \\";
@@ -542,11 +544,13 @@
 void EnergyPlotLine(ofstream &output, class MatrixContainer &Energy, const char *prefix, const char *xargument, const char *uses)
 {
-  char item[1024];
   stringstream line(Energy.Header);
-
-  line >> item;
-  for (int i=2; i<= Energy.ColumnCounter;i++) {
-    line >> item;
-    output << "'" << prefix << ".dat' title '" << item << "' using " << xargument << ":" << i+2 << " " << uses;
+  string token;
+
+  getline(line, token, '\t');
+  for (int i=1; i<= Energy.ColumnCounter;i++) {
+    getline(line, token, '\t');
+    while (token[0] == ' ') // remove leading white spaces
+      token.erase(0,1);
+    output << "'" << prefix << ".dat' title '" << token << "' using " << xargument << ":" << i+2 << " " << uses;
     if (i != (Energy.ColumnCounter))
       output << ", \\";
@@ -564,21 +568,23 @@
 void ForceMagnitudePlotLine(ofstream &output, class MatrixContainer &Force, const char *prefix, const char *xargument, const char *uses)
 {
-  char item[1024];
   stringstream line(Force.Header);
-
-  line >> item;
-  line >> item;
-  line >> item;
-  line >> item;
-  line >> item;
+  string token;
+
+  getline(line, token, '\t');
+  getline(line, token, '\t');
+  getline(line, token, '\t');
+  getline(line, token, '\t');
+  getline(line, token, '\t');
   for (int i=7; i< Force.ColumnCounter;i+=NDIM) {
-    line >> item;
-    item[strlen(item)-1] = '\0';  // kill residual index char (the '0')
-    output << "'" << prefix << ".dat' title '" << item << "' using " << xargument << ":(sqrt($" << i+1 << "*$" << i+1 << "+$" << i+2 << "*$" << i+2 << "+$" << i+3 << "*$" << i+3 << ")) " << uses;
+    getline(line, token, '\t');
+    while (token[0] == ' ') // remove leading white spaces
+      token.erase(0,1);
+    token.erase(token.length(), 1);  // kill residual index char (the '0')
+    output << "'" << prefix << ".dat' title '" << token << "' using " << xargument << ":(sqrt($" << i+1 << "*$" << i+1 << "+$" << i+2 << "*$" << i+2 << "+$" << i+3 << "*$" << i+3 << ")) " << uses;
     if (i != (Force.ColumnCounter-1))
       output << ", \\";
     output << endl;
-    line >> item;
-    line >> item;
+    getline(line, token, '\t');
+    getline(line, token, '\t');
   }
 };
@@ -593,21 +599,23 @@
 void AbsFirstForceValuePlotLine(ofstream &output, class MatrixContainer &Force, const char *prefix, const char *xargument, const char *uses)
 {
-  char item[1024];
   stringstream line(Force.Header);
-
-  line >> item;
-  line >> item;
-  line >> item;
-  line >> item;
-  line >> item;
+  string token;
+
+  getline(line, token, '\t');
+  getline(line, token, '\t');
+  getline(line, token, '\t');
+  getline(line, token, '\t');
+  getline(line, token, '\t');
   for (int i=7; i< Force.ColumnCounter;i+=NDIM) {
-    line >> item;
-    item[strlen(item)-1] = '\0';  // kill residual index char (the '0')
-    output << "'" << prefix << ".dat' title '" << item << "' using " << xargument << ":(abs($" << i+1 << ")) " << uses;
+    getline(line, token, '\t');
+    while (token[0] == ' ') // remove leading white spaces
+      token.erase(0,1);
+    token.erase(token.length(), 1);  // kill residual index char (the '0')
+    output << "'" << prefix << ".dat' title '" << token << "' using " << xargument << ":(abs($" << i+1 << ")) " << uses;
     if (i != (Force.ColumnCounter-1))
       output << ", \\";
     output << endl;
-    line >> item;
-    line >> item;
+    getline(line, token, '\t');
+    getline(line, token, '\t');
   }
 };
@@ -622,22 +630,24 @@
 void BoxesForcePlotLine(ofstream &output, class MatrixContainer &Force, const char *prefix, const char *xargument, const char *uses)
 {
-  char item[1024];
   stringstream line(Force.Header);
   char *fillcolor[5] = {"black", "red", "blue", "green", "cyan"};
-
-  line >> item;
-  line >> item;
-  line >> item;
-  line >> item;
-  line >> item;
+  string token;
+
+  getline(line, token, '\t');
+  getline(line, token, '\t');
+  getline(line, token, '\t');
+  getline(line, token, '\t');
+  getline(line, token, '\t');
   for (int i=7; i< Force.ColumnCounter;i+=NDIM) {
-    line >> item;
-    item[strlen(item)-1] = '\0';  // kill residual index char (the '0')
-    output << "'" << prefix << ".dat' title '" << item << "' using ($" << xargument << "+" << fixed << setprecision(1) << (double)((i-7)/3)*0.2 << "):(sqrt($" << i+1 << "*$" << i+1 << "+$" << i+2 << "*$" << i+2 << "+$" << i+3 << "*$" << i+3 << ")) " << uses << " " << fillcolor[(i-7)/3];
+    getline(line, token, '\t');
+    while (token[0] == ' ') // remove leading white spaces
+      token.erase(0,1);
+    token.erase(token.length(), 1);  // kill residual index char (the '0')
+    output << "'" << prefix << ".dat' title '" << token << "' using ($" << xargument << "+" << fixed << setprecision(1) << (double)((i-7)/3)*0.2 << "):(sqrt($" << i+1 << "*$" << i+1 << "+$" << i+2 << "*$" << i+2 << "+$" << i+3 << "*$" << i+3 << ")) " << uses << " " << fillcolor[(i-7)/3];
     if (i != (Force.ColumnCounter-1))
       output << ", \\";
     output << endl;
-    line >> item;
-    line >> item;
+    getline(line, token, '\t');
+    getline(line, token, '\t');
   }
 };
@@ -652,22 +662,24 @@
 void BoxesFirstForceValuePlotLine(ofstream &output, class MatrixContainer &Force, const char *prefix, const char *xargument, const char *uses)
 {
-  char item[1024];
   stringstream line(Force.Header);
   char *fillcolor[5] = {"black", "red", "blue", "green", "cyan"};
-
-  line >> item;
-  line >> item;
-  line >> item;
-  line >> item;
-  line >> item;
+  string token;
+
+  getline(line, token, '\t');
+  getline(line, token, '\t');
+  getline(line, token, '\t');
+  getline(line, token, '\t');
+  getline(line, token, '\t');
   for (int i=7; i< Force.ColumnCounter;i+=NDIM) {
-    line >> item;
-    item[strlen(item)-1] = '\0';  // kill residual index char (the '0')
-    output << "'" << prefix << ".dat' title '" << item << "' using ($" << xargument << "+" << fixed << setprecision(1) << (double)((i-7)/3)*0.2 << "):" << i+1 << " " << uses << " " << fillcolor[(i-7)/3];
+    getline(line, token, '\t');
+    while (token[0] == ' ') // remove leading white spaces
+      token.erase(0,1);
+    token.erase(token.length(), 1);  // kill residual index char (the '0')
+    output << "'" << prefix << ".dat' title '" << token << "' using ($" << xargument << "+" << fixed << setprecision(1) << (double)((i-7)/3)*0.2 << "):" << i+1 << " " << uses << " " << fillcolor[(i-7)/3];
     if (i != (Force.ColumnCounter-1))
       output << ", \\";
     output << endl;
-    line >> item;
-    line >> item;
-  }
-};
+    getline(line, token, '\t');
+    getline(line, token, '\t');
+  }
+};
Index: src/parser.cpp
===================================================================
--- src/parser.cpp	(revision 4aa03a552cf306f8b3265e786d08e545bf01bed4)
+++ src/parser.cpp	(revision fb936468428f5110b9922aa5f20ccb14c1c45e08)
@@ -115,4 +115,5 @@
   char *FragmentNumber = NULL;
   stringstream file;
+  string token;
   
   Header = (char *) Malloc(sizeof(char)*1023, "MatrixContainer::ParseMatrix: *EnergyHeader");
@@ -167,8 +168,6 @@
     //cout << line.str() << endl;
     ColumnCounter=0;
-    while (!line.eof()) {   
-      strcpy(filename,"@");
-      line >> filename;
-      if (filename[0] != '@')
+    while ( getline(line,token, '\t') ) {
+      if (token.length() > 0)
         ColumnCounter++;
     }
