Git Product home page Git Product logo

sixarm_ruby_spreadsheeting's Introduction

SixArm.com → Ruby →
Spreadsheeting gem has import & export helpers for CSV, TSV, Excel, etc.

Introduction

String helpers for importing, exporting, and parsing spreadsheet data.

This is useful for reading and writing files in CSV, TSV, Excel, etc.

For docs go to http://sixarm.com/sixarm_ruby_spreadsheeting/doc

Want to help? We're happy to get pull requests.

Install

Gem

To install this gem in your shell or terminal:

gem install sixarm_ruby_spreadsheeting

Gemfile

To add this gem to your Gemfile:

gem 'sixarm_ruby_spreadsheeting'

Require

To require the gem in your code:

require 'sixarm_ruby_spreadsheeting'

Details

Some spreadsheet programs use cells that can have different types of data, such as:

  • a date like "2010/12/31"
  • a boolean flag like "+" or "-"
  • a freeform text note like "Hello"

This gem has methods for parsing and printing these individually and in combinations.

Example

Require:

require "sixarm_ruby_spreadsheeting"

To import a spreadsheet cell's text that may be a date or a freeform note:

date, note = import_date_or_note("2010/12/31") 
=> [<Date: 2010-12-31>, nil]

date, note = import_date_or_note("Hello") 
=> [nil, "Hello"]

To export either a date or a note to spreadsheet cell text:

date = Date.today
note = nil
export_date_or_note(date, text)  #=> "2010/12/31"

date = nil
note = "Hello"
export_date_or_note(date, text)  #=> "Hello"

sixarm_ruby_spreadsheeting's People

Contributors

joelparkerhenderson avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.