O'Reilly logo

Wicked Cool Ruby Scripts by Steve Pugh

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

Comma-Separated Value Parser

Comma-Separated Value Parser

csv.rb

Comma-separated value (CSV) files are very prevalent in our digital world. They are used everywhere, and many programs have functions to input or output information in the CSV format. Even Microsoft supports CSV in the majority of its products!

This script will show you how to customize data output once it has been delimited by commas in a CSV file. This will lead to more meaningful interpretation of the data. Two libraries can help you work with CSV files: The first is the old standard Ruby CSV library, and the second is a library called FasterCSV. I will show you how to use FasterCSV and seamlessly integrate it into your scripts. Just note that when you upgrade past 1.8, FasterCSV ...

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