title: how can i correctly parse a text file delimited by white space
body: <p>Below is my sample text file</p>
  
  <p><img src="https://i.stack.imgur.com/RUaap.png" alt="enter image description here">
                  {</p>
  
  <p>Here is my schema file</p>
  
  <pre><code>[Sample File.txt]
  ColNameHeader=True
  Format=TabDelimited
  CharacterSet=ANSI
  </code></pre>
  
  <p>And here is the code i have so far writen to try and read the above sample file, the data rows read from the text file above is supposed to be returned for display in a dataGridView control. The problem is, its being returned as single column, yet i want to use those white spaces as the column delimiters. I have tried different character delimiters with out success.</p>
  
  <pre><code>public DataSet LoadCSV(int numberOfRows)
      {
          DataSet ds = new DataSet();
              // Creates and opens an ODBC connection
              string strConnString = "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" + this.dirCSV.Trim() + ";Extensions=asc,csv,tab,txt;Persist Security Info=False";
  
              string sql_select;
              OdbcConnection conn;
              conn = new OdbcConnection(strConnString.Trim());
              conn.Open();
  
              //Creates the select command text
              if (numberOfRows == -1)
              {
                  sql_select = "select * from [" + this.FileNevCSV.Trim() + "]";
              }
              else
              {
                  sql_select = "select top " + numberOfRows + " * from [" + this.FileNevCSV.Trim() + "]";
              }
  
              //Creates the data adapter
              OdbcDataAdapter obj_oledb_da = new OdbcDataAdapter(sql_select, conn);
  
              //Fills dataset with the records from CSV file
              obj_oledb_da.Fill(ds, "csv");
  
              //closes the connection
              conn.Close();
  
          return ds;
      }
  </code></pre>
  
  <p>And setting the dataGridView's data source like to </p>
  
  <pre><code>    // loads the first 500 rows from CSV file
  this.dataGridView_preView.DataSource = LoadCSV(500);
  this.dataGridView_preView.DataMember = "csv";
  </code></pre>
  
  <p>i, get this in the datagridview, i get one column yet i expect to see the data returned as 7 columns. </p>
  
  <p>Plus, i have no idea where F2 and F3 columns are coming from</p>
  
  <p><img src="https://i.stack.imgur.com/X6rvl.png" alt="enter image description here"></p>