Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Daniel1of1/CSwiftV
A csv parser written in swift conforming to rfc4180
https://github.com/Daniel1of1/CSwiftV
Last synced: 6 days ago
JSON representation
A csv parser written in swift conforming to rfc4180
- Host: GitHub
- URL: https://github.com/Daniel1of1/CSwiftV
- Owner: Daniel1of1
- License: bsd-3-clause
- Created: 2014-08-31T19:34:35.000Z (over 10 years ago)
- Default Branch: develop
- Last Pushed: 2023-03-14T03:41:33.000Z (over 1 year ago)
- Last Synced: 2024-05-29T10:35:11.741Z (7 months ago)
- Language: Swift
- Homepage:
- Size: 89.8 KB
- Stars: 170
- Watchers: 10
- Forks: 46
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - CSwiftV - A csv parser written in swift conforming to rfc4180. (Parsing / CSV)
- awesome-ios-star - CSwiftV - A csv parser written in swift conforming to rfc4180. (Parsing / CSV)
README
# CSwiftV
A csv parser conforming (and tested as much) to [rfc4180](http://tools.ietf.org/html/rfc4180#section-2) i.e the closest thing to a csv spec.
It is currently all in memory so not suitable for very large files.
### TL;DR
```swift
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"]
// ]```