title: Xcode - Create csv/spreadsheet file
body: <p>I have three arrays. The first array contains strings, same as the second, however the third one contains <code>NSNumber</code>'s. Anyways, back on topic... how can I create a csv (which is an excel/numbers) file like a spreadsheet to contain this data. Is it possible?</p>
  
  <p>These are my three arrays:</p>
  
  <p>locationArray - contains many strings
  dateArray - contains many strings
  milesArray - contains many <code>NSNumber</code>'s</p>
  
  <p>But each array contains the same amount of objects so (for example in a table view) you can piece the data together in an <code>NSDictionary</code>. It is like a chain.</p>
  
  <p>So then it would look like this:</p>
  
  <pre><code>NSDictionary *firstFlight = [NSDictionary dictionaryWithObjectsAndKeys:[locationArray objectAtIndex: 0], @"FlightName", [dateArray objectAtIndex: 0], @"FlightDate", [milesArray objectAtIndex: 0], @"FlightMiles", nil];
  </code></pre>
  
  <p>And that dictionary would contain a flight (the functionality of this test app is to log flights). So if I enumerated this using a <code>for</code> loop and replaced <code>objectAtIndex:</code> with the looped number I could get many dictionaries of the flights.</p>
  
  <p>Now that you understand how my data structure works. How can I create an excel/numbers/spreadsheet CSV file to look like this for example (just a screencapture from what it could look like):</p>
  
  <p>(MILES DATA IS JUST MADE UP)</p>
  
  <p><img src="https://i.stack.imgur.com/6vV8j.png" alt="enter image description here"></p>