Use the csv.lua module for parsing CSV files. This code is designed to handle well formed CSV files. However CSV implementations can vary, so you should test it using realistic samples.
This page presents the csv module by itself, so you can copy it directly into your project. However if you prefer to experiment with some sample code that uses the csv module then you should consider importing our Parse a CSV file channel from the Builtin: Iguana Tools repository.