Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve docs #13

Open
Daniel1of1 opened this issue May 10, 2016 · 4 comments
Open

improve docs #13

Daniel1of1 opened this issue May 10, 2016 · 4 comments

Comments

@Daniel1of1
Copy link
Owner

No description provided.

@sohaeb
Copy link

sohaeb commented Jul 28, 2016

Hey, thanks for this. Can you add something to the doc like: what if I need to read from a csv file ? should I read it line by line using swift string methods then call that string using CSwiftV(String: inputString) ? or should I use something else ?

Sorry for this question but I'm new to programming and have no idea how to use your framework to read from a csv file

@Daniel1of1
Copy link
Owner Author

Thanks for the comment that's really useful. This will go in.

For now, for your particular question, the library works on a single string. So if you want to read from a file, you would do something along the lines of:

let inputString = try! String(contentsOfFile: "path/to/file")

let csv = CSwiftV(String: inputString)

Then on csv you can ask for .rows or .keyedRows which will give you either an 'array' of rows (and a row is an array of strings) or an array of 'keyedRows' which are dictionaries of type [String:String] which have the header of the column as their key.

@thully
Copy link

thully commented Oct 3, 2016

One thing that could be added to the doc is - how do I include this in my project? I tried building it and dragging the .framework over to another project's Frameworks, but it didn't work. I eventually got it to work with CocoaPods, though I had to manually update the out-of-date code it downloaded to replace it with Swift 3-compatible code

@Daniel1of1
Copy link
Owner Author

Nice @thully thanks, check out my comment for the other issue by the way incase it helps in any way. #29 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants