Skip to content

Ruby script for reading and manipulation of Excel documents through metaprogramming.

Notifications You must be signed in to change notification settings

VasilijeJukic01/Excel-Reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Ruby Excel Reader

Introduction

This Ruby script is designed to work with Excel documents, focusing on metaprogramming principles. The library allows users to interact with tables, assuming each table has a header row and an optional last row that can serve as a sum row.

Features

  1. Retrieving Table Values
    table.to_2d_array
  2. Accessing Rows
    table.row(1)
  3. Implemented an each function to iterate over all cells in the table from left to right.
    table.each { |row| puts row }
  4. Handling Merged Fields
    Merged fields are automatically handled by the library.
  5. Enhanced Syntax for Accessing and Setting Values
    table['Name']
    table['Name'][2]
    table['Name', 2] = 'Value'
  6. Direct Column Access
    table.Name
  7. Subtotal/Average Calculation
    table.column.sum
    table.column.avg
  8. Retrieving Row By Cell
    table.Name.value
  9. Column Functions (map, select, reduce)
    table.column.map { |x| x * 2}
    table.column.select { |x| x > 2 }
    table.column.reduce(0) { |sum, x| sum + x }
  10. Table Addition and Subtraction
    table1 + table2
    table1 - table2
  11. Ignoring Rows with Keywords
    Rows containing "total" or "subtotal" are automatically ignored.

About

Ruby script for reading and manipulation of Excel documents through metaprogramming.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages