예제 #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
    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)
예제 #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)
예제 #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)
예제 #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))