Skip to content
A csv parser written in swift conforming to rfc4180
Swift Ruby
Branch: develop
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
CSwiftV.xcodeproj
Sources/CSwiftV
Tests Include quotes as part of the cells May 31, 2019
.gitignore mpve to using spm to generate xcode proj May 31, 2019
CSwiftV.podspec
LICENSE
Package.swift
README.md

README.md

CSwiftV

A csv parser conforming (and tested as much) to rfc4180 i.e the closest thing to a csv spec.

It is currently all in memory so not suitable for very large files.

TL;DR

let inputString = "Year,Make,Model,Description,Price\r\n1997,Ford,E350,descrition,3000.00\r\n1999,Chevy,Venture,another description,4900.00\r\n"

let csv = CSwiftV(with: inputString)

let rows = csv.rows // [
                    //  ["1997","Ford","E350","descrition","3000.00"],
                    //  ["1999","Chevy","Venture","another description","4900.00"]
                    // ]

let headers = csv.headers // ["Year","Make","Model","Description","Price"]

let keyedRows = csv.keyedRows // [
                              //  ["Year":"1997","Make":"Ford","Model":"E350","Description":"descrition","Price":"3000.00"],
                              //  ["Year":"1999","Make":"Chevy","Model":"Venture","Description":"another, description","Price":"4900.00"]
                              // ]
You can’t perform that action at this time.