CSwiftV 0.0.9

CSwiftV 0.0.9

测试已测试
Lang语言 SwiftSwift
许可证 BSD-3-Clause
发布最后发布2019年3月
SPM支持 SPM

Daniel Haight 维护。



CSwiftV 0.0.9

CSwiftV

一个符合(并测试了)rfc4180的 csv 解析器,即(csv)规范最接近的东西。

目前它是全部在内存中的,所以不适合非常大的文件。

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"]
                              // ]