title: Parsing a sample text file and splitting it up
body: <p>I'm attempting to go through a simple text file with assembly instruction in it and it looks like this</p>
  
  <pre><code>TOP   NOP
  VAL   INT 0
  TAN   LA 2,1
  </code></pre>
  
  <p>This is just a small example so I can show you how it works. Basically I'm taking the first labels and placing them in label, then the second which are NOP, INT, and LA and placing them in opcode.</p>
  
  <p>After that I'm taking the first argument (0 and 2) and placing them in arg1. However here is where my problem comes in. With the current code I have, the output I get when I place the arguments into the string is as such</p>
  
  <pre><code>TOP
  0
  2
  </code></pre>
  
  <p>Obviously I'd like to only get the last two to be the only ones but how do I make it so that TOP doesn't get thrown in there with my first arguments?</p>
  
  <pre><code>#include &lt;string&gt;
  #include &lt;iostream&gt;
  #include &lt;cstdlib&gt;
  #include &lt;string.h&gt;
  #include &lt;fstream&gt;
  #include &lt;stdio.h&gt;
  
  using namespace std;
  
  int main(int argc, char *argv[])
  {
  // If no extra file is provided then exit the program with error message
  if (argc &lt;= 1)
  {
      cout &lt;&lt; "Correct Usage: " &lt;&lt; argv[0] &lt;&lt; " &lt;Filename&gt;" &lt;&lt; endl;
      exit (1);
  }
  
  // Array to hold the registers and initialize them all to zero
  int registers [] = {0,0,0,0,0,0,0,0};
  
  string memory [16000];
  
  string Symtablelab[1000];
  int Symtablepos[1000];
  
  string line;
  string label;
  string opcode;
  string arg1;
  string arg2;
  
  // Open the file that was input on the command line
  ifstream myFile;
  myFile.open(argv[1]);
  
  if (!myFile.is_open())
  {
      cerr &lt;&lt; "Cannot open the file." &lt;&lt; endl;
  }
  
  int counter = 0;
  int i = 0;
  int j = 0;
  
  while (getline(myFile, line, '\n'))
  {
      if (line[0] == '#')
      {
          continue;
      }
  
      if (line.length() == 0)
      {
          continue;
      }
  
      if (line[0] != '\t' &amp;&amp; line[0] != ' ')
      {
          string delimeters = "\t ";
  
          int current;
          int next = -1;
  
          current = next + 1;
          next = line.find_first_of( delimeters, current);
          label = line.substr( current, next - current );
  
          Symtablelab[i] = label;
  
          current = next + 1;
          next = line.find_first_of(delimeters, current);
          opcode = line.substr(current, next - current);
  
          if (opcode != "WORDS" &amp;&amp; opcode != "INT")
          {
              counter += 3;
          }
  
          if (opcode == "INT")
          {
              counter++;
          }
  
          delimeters = ", \n\t";
          current = next + 1;
          next = line.find_first_of(delimeters, current);
          arg1 = line.substr(current, next-current);
  
          cout &lt;&lt; arg1&lt;&lt;endl;
  
          i++;
      }
  }
  </code></pre>