title: how to ignore a character while reading from a file in c++
body: <p>I'm trying to write a program that will take a text file I have that has a bunch of contact info in it and store it in an array for later use. the text file doesn't have new lines it is just in the format of "Last name", "Last Name, First Name", "Phone-Number", "Email-Address", "Home Address", "Last Name, First Name", "Phone Number","Email Address","","",""</p>
  
  <p>So I want to read from the file and take all the data members and save them, the problem is that sometimes it has the name/number inside the "name" and sometimes it just has an empty set of quotes such as "" and occasionally it just has space and another comma like "Phone Number",,"",   so i want to be able to check if there is a quote and if there is then read the data till the following " and if there isn't a quote just two consecutive commas then to read nothing into that data field and move onto the next one.</p>
  
  <p>I'm in my junior year of computer science classes in college so i understand somewhat about programing but not everything so try not to blow me out of the water with the correct way. This is a personal project not any type of homework just so you know.</p>
  
  <p>the function i have so far looks like this</p>
  
  <pre><code>void Info::readFile(ifstream&amp; in)
  {
      if (in.good())
      {
          in &gt;&gt; lastName;
      }
      else if (in.bad() || in.fail())
      {
          throw BadException();
      }
      if (in.good())
      {
          in &gt;&gt; lastName;
      }
      else if (in.bad() || in.fail())
      {
          throw BadException();
      }
      if (in.good())
      {
          in &gt;&gt; firstName;
      }
      else if (in.bad() || in.fail())
      {
          throw BadException();
      }
      if (in.good())
      {
          in &gt;&gt; phoneNumber;
      }
      else if (in.bad() || in.fail())
      {
          throw BadException();
      }
      //same code adding other data members
  }
  </code></pre>