Пример #1
1
def main(base_dir):
    r=Reader(os.path.join(base_dir, "tutorial_datatype_02.ods"))
    to_array(r)
    
    def cleanse_func(v):
        v = v.replace(" ", "")
        v = v.rstrip().strip()
        return v
    
    sf = SheetFormatter(cleanse_func)
    r.add_formatter(sf)
    to_array(r)
Пример #2
0
def main(base_dir):
    r = Reader(os.path.join(base_dir, "tutorial_datatype_02.ods"))
    to_array(r)

    def cleanse_func(v):
        v = v.replace(" ", "")
        v = v.rstrip().strip()
        return v

    sf = SheetFormatter(cleanse_func)
    r.add_formatter(sf)
    to_array(r)
Пример #3
0
from pyexcel import Reader
from pyexcel.utils import to_array
from pyexcel.formatters import SheetFormatter
from pyexcel.formatters import STRING_FORMAT

r=Reader("tutorial_datatype_02.ods")
to_array(r)

def cleanse_func(v, t):
    v = v.replace(" ", "")
    v = v.rstrip().strip()
    return v

sf = SheetFormatter(STRING_FORMAT, cleanse_func)
r.add_formatter(sf)
to_array(r)