title: Objective C read csv file and use array
body: <p>I have a csv file as this:</p>
  
  <pre><code>1#one#two#three#four; 
  2#apple#tower#flower#robot;
  </code></pre>
  
  <p>I read this file with this code:</p>
  
  <pre><code>NSString *resourceFileName = @"PrenotazioniDb";
  NSString *pathToFile =[[NSBundle mainBundle] pathForResource: resourceFileName ofType: @"txt"];
  NSError *error;
  
  NSString *fileString = [NSString stringWithContentsOfFile:pathToFile encoding:NSUTF8StringEncoding error:&amp;error];
  if (!fileString) {
      NSLog(@"Error reading file.");
  } 
  NSScanner *scanner = [NSScanner scannerWithString:fileString];    
  [scanner setCharactersToBeSkipped:[NSCharacterSet characterSetWithCharactersInString:@"\n#; "]];
  
  NSString *one = nil, *two = nil, *three = nil, *four = nil; 
  while ([scanner scanUpToString:@"#" intoString:&amp;one] &amp;&amp; [scanner scanUpToString:@"#" intoString:&amp;two] &amp;&amp; [scanner scanUpToString:@"#" intoString:&amp;three] &amp;&amp; [scanner scanUpToString:@"#" intoString:&amp;four]{
  
  
  }
  </code></pre>
  
  <p>but I want memorize the file in an array, What can I do? I should use two array: one for line and one for single word; for example in first array in a position I store</p>
  
  <pre><code>1#one#two#three#four;
  </code></pre>
  
  <p>and in the second array I store in first position "1" in second "one" in third "two" ext....</p>
  
  <p>What Can i Do?</p>