title: How to use boost split to split a string and ignore empty values?
body: <p>I am using boost::split to parse a data file. The data file contains lines such as the following.</p>
  
  <p>data.txt</p>
  
  <pre><code>1:1~15  ASTKGPSVFPLAPSS SVFPLAPSS   -12.6   98.3    
  </code></pre>
  
  <p>The white space between the items are tabs. The code I have to split the above line is as follows.</p>
  
  <pre><code>std::string buf;
  /*Assign the line from the file to buf*/
  std::vector&lt;std::string&gt; dataLine;
  boost::split( dataLine, buf , boost::is_any_of("\t "), boost::token_compress_on);       //Split data line
  cout &lt;&lt; dataLine.size() &lt;&lt; endl;
  </code></pre>
  
  <p>For the above line of code I should get a print out of 5, but I get 6. I have tried to read through the documentation and this solution seems as though it should do what I want, clearly I am missing something. Thanks!</p>
  
  <p>Edit:
  Running a forloop as follows  on dataLine you get the following.</p>
  
  <pre><code>cout &lt;&lt; "****" &lt;&lt; endl;
  for(int i = 0 ; i &lt; dataLine.size() ; i ++) cout &lt;&lt; dataLine[i] &lt;&lt; endl;
  cout &lt;&lt; "****" &lt;&lt; endl;
  
  
  ****
  1:1~15
  ASTKGPSVFPLAPSS
  SVFPLAPSS
  -12.6
  98.3
  
  ****
  </code></pre>