Project

cellar

0.0
The project is in a healthy, maintained state
Ruby gem to deal with cells of data in rows and columns
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

cellar

Ruby gem to deal with cells of data in rows and columns (CSV, spreadsheets, etc.)

Example

Sample code:

# read CSV
data = DATA.read
rows = data.split("\n").map {|line| line.split(",") }

# show output
info = Cellar.new(rows)
info.each do
  p info[:id, 4, "name", "gym".."age", 6..4, :color, "CaNdY"]
end

__END__
id,name,age,school,gym,color,candy,pet
1,joe,13,Rockville,Gold's,yellow,gum,bird
2,sally,8,Melville,24 Hour Fitness,pink,skittles,pig
3,curly,44,Vegas,Couch,purple,Snicker's,lizard

Sample output:

["1", "Gold's", "joe", "Gold's", "Rockville", "13", "gum", "yellow", "Gold's", "yellow", "gum"]
["2", "24 Hour Fitness", "sally", "24 Hour Fitness", "Melville", "8", "skittles", "pink", "24 Hour Fitness", "pink", "skittles"]
["3", "Couch", "curly", "Couch", "Vegas", "44", "Snicker's", "purple", "Couch", "purple", "Snicker's"]