Skip to content
Ruby C Shell
Latest commit 428fbab Dec 15, 2014 @zhum zhum Update ccsv.gemspec
Failed to load latest commit information.
ext - multiline support added: #7 Nov 20, 2014
spec - multiline support added: #7 Nov 20, 2014
CHANGELOG - version 1.1.0 Sep 29, 2014
Gemfile - v1.0.4 May 26, 2014
LICENSE initial checkin Sep 26, 2007
Manifest - multiline support added: #7 Nov 20, 2014
README.rdoc - version 1.1.0 Sep 29, 2014
Rakefile - multiline support added: #7 Nov 20, 2014
ccsv.gemspec Update ccsv.gemspec Dec 15, 2014
compile - multiline support added: #7 Nov 20, 2014

README.rdoc

Ccsv

A pure-C CSV parser.

Installation

gem install ccsv

Usage

require 'rubygems'
require 'ccsv'

Ccsv.foreach("data.csv") do |line|
  # Do something with the line array
end

# print all logins
Ccsv.foreach("/etc/passwd",":") do |line|
  puts line[0]
end

Advanced usage

Get users from passwd file, with UIDs between 1000 and 1010 and between 2000 and 2010. Works with numbers only! Third argument is column index, used for filtering, then one or more intervals.

Ccsv.foreach("/etc/passwd",":",2,[1000..1010],[2000..2010]) do |line|
  puts line[0]
end

Contacts

Forks, pull-requests and other contacts via guthub: http://github.com/evan/ccsv/

License

Copyright 2012-2014 Sergey Zhumatiy

Copyright 2007-2012 Cloudburst, LLC. Licensed under the AFL 3. See the included LICENSE file.

Something went wrong with that request. Please try again.