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

support very generic parsing #43

Open
LogicalTime opened this issue Nov 3, 2016 · 3 comments
Open

support very generic parsing #43

LogicalTime opened this issue Nov 3, 2016 · 3 comments

Comments

@LogicalTime
Copy link

Sometimes you just want a Seq[Seq[String]] from a csv file. The documentation/examples do not seem to support this core functionality.

@marklister
Copy link
Owner

 scala> val csv = """1,2,3
      | 4,5,6"""
 csv: String =
 1,2,3
 4,5,6

 scala> new CSVReader(csv).toList
 res7: List[Array[String]] = List(Array(1, 2, 3), Array(4, 5, 6))

This is a documentation issue I think. CSVReader is an Iterator. It copies OpenCsv's interface pretty closely.

@marklister
Copy link
Owner

marklister commented Nov 3, 2016

 scala> new CSVReader(new java.io.StringReader(csv)).toList
 res13: List[Array[String]] = List(Array(1, 2, 3), Array(4, 5, 6))

There must be some implicit going on in the first example. Use the second.

@LogicalTime
Copy link
Author

Thanks! very helpful.

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

No branches or pull requests

2 participants