title: Swift: Import .csv as a string
body: <p>I am using Swift to import a <strong>.csv</strong> file stored in the project. However, I always get the error </p>
  
  <pre><code>fatal error: unexpectedly found nil while unwrapping an Optional value
  </code></pre>
  
  <p>I tried doing the same thing but converted it to a <strong>.txt</strong> file, and that failed also. However, if I just copy and paste the contents directly into a new <strong>.txt</strong> file, it works. I am just trying to turn this into a string so that I can work with it later. </p>
  
  <pre><code>let file = NSBundle.mainBundle().pathForResource("SL", ofType:"csv")
  var text = String(contentsOfFile: file!, encoding: NSUTF8StringEncoding, error: nil)!
  var rawStudents = text.componentsSeparatedByString("\n")
  </code></pre>