title: Cleaning a data file to be read as only numbers in C++
body: <p>I need to read with C++ a file with extension .wdx (Mathematica provided). I've been able to get the file as a .dat and .txt obtaining something like this minimal example (dummyValues.dat):</p>
  
  <pre><code>{5.12, 0.1, 0.25}   {{0.10, 4, 3, 2, 1, 1.44, 10.2}}       {11.1, 12.2, 13.3, 14.4, 15.5, 16.6} X
  </code></pre>
  
  <p>As you can see it's a mess with blank spaces and {, } symbols. I'm only interested on getting a file with numbers (decimal is indicated with dot, '.'). How can I do this through the .wdx file or the .dat? </p>
  
  <hr>
  
  <p>I have tried this </p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;cmath&gt;
  #include&lt;string&gt;
  #include"complejos.h"//'using namespace std;' command is in here
  #include&lt;fstream&gt;
  #include&lt;iomanip&gt;
  
  int main() {
  
  double dato;
  char aux;
  ifstream benchmarks;
  
  benchmarks.open("dummyValues.dat");
  
  if (benchmarks.is_open()) {//first if
  
    benchmarks.get(aux);
  
    while (aux != "X") {
  
      if (aux == "{" || aux == "}" || aux == "," || aux == " ") {
        benchmarks.get(aux);
      } else {
        benchmarks&gt;&gt;dato;
        cout&lt;&lt;dato;
        benchmarks.get(aux);
      };
    };//end of while
  
  } else {
    cout&lt;&lt;"ERROR: couldnt open the file"&lt;&lt;endl;
  };//end of first if
  
  
  
  benchmarks.close();
  
  return 0;
  }; //end of main
  
  </code></pre>
  
  <p>But I get this error:</p>
  
  <pre><code>
  error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
     while (aux != "X") {
                   ^~~
   error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
       if (aux == "{" || aux == "}" || aux == "," || aux == " ") {
                  ^~~
   error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
       if (aux == "{" || aux == "}" || aux == "," || aux == " ") {
                                ^~~
   error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
       if (aux == "{" || aux == "}" || aux == "," || aux == " ") {
                                              ^~~
  error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
       if (aux == "{" || aux == "}" || aux == "," || aux == " ") {
  
  </code></pre>