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)
Exemple #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)
Exemple #3
0
    def setUp(self):
        """
        Make a test csv file as:

        1,2,3,4
        5,6,7,8
        9,10,11,12
        """
        self.testfile = "testcsv.xlsx"
        create_sample_file2(self.testfile)
        self.iteratable = Reader(self.testfile)
Exemple #4
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)
Exemple #5
0
from pyexcel import Reader
from pyexcel.utils import to_array
import json

# "example.xls","example.xlsx","example.ods", "example.xlsm"
reader = Reader("example.csv")
data = to_array(reader.rows())
print json.dumps(data)
Exemple #6
0
def main(base_dir):
    # "example.xls","example.xlsx","example.ods", "example.xlsm"
    reader = Reader(os.path.join(base_dir,"example.csv"))
    data = to_array(reader.rows())
    print(json.dumps(data))