0.01
No commit activity in last 3 years
No release in over 3 years
Extract columnar data from tabulated fixed-width text
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Detabulator

Extract columnar data from tabulated fixed-width text.

Example

Given some tabulated data:

sample = <<END
            Column 1    Column 2
Drinks      Beer        Whiskey
Not drinks  Toothpaste  Mouthwash
END

This:

require "detabulator"
Detabulator.new.detabulate(sample)

Will produce this:

[["", "Column 1", "Column 2"],
 ["Drinks", "Beer", "Whiskey"],
 ["Not drinks", "Toothpaste", "Mouthwash"]] 

This is just a first release that does something useful.

Limitations

  • Double-width characters (e.g. Japanese) are not handled correctly.
  • Combining diacritics are not handled correctly.
  • When one cell contains much longer text and a space, an extra column is generated.