O'Reilly logo

Text Processing with Ruby by Rob Miller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The CSV Format

It’s for good reason that the example file we started with was the humble TSV file. It’s probably the simplest sort of delimited data we’re likely to encounter. However, the most common format by far is the comma-separated values (CSV) file. It is, for better or for worse, the standard file format for exporting data from and importing data to websites, databases, spreadsheets, and pretty much any other data store. If you haven’t encountered CSV files in your development so far, you’re virtually guaranteed to at some point.

Initially, it might seem like a simple proposition to parse CSV files. You might think that you can set your field separator to , rather than a tab character, and then generally proceed as you did for TSV files. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required