Thanks AppleFritter! I tried using the sample code but I am getting the error "CSV parse error: EIF - CR char inside unquoted, not part of EOL..."
I tried looking up the error and found that this could be a data problem. I have recreated the same sample I gave and made sure that there are no extra characters/spaces but still getting the same result. Any idea why I am getting this?