split excel sheet for every nrows using python -
i have excel file more 1 million rows. need split every n rows , save in new file. new python. help, appreciated , needed
as suggested ohauth can save excel document csv
file. start begin processing of data.
processing data can use python csv library. not require installation since comes python automatically.
if want more "powerful" might want pandas. however, requires installation of module.
if not want use csv
module of python nor pandas
module because not want read docs, like.
f = open("mycsvfile", "r") row in f: singlerow = row.split(",") #replace "," delimiter chose seperate columns print singlerow > [value1, value2, value3, ...] #it returns list , list comprehension documented , easy understand, thus, further processing wont difficult
however, recommend looking moduls since handle csv
data better, more efficient , on 'the long shot' save time , trouble.
Comments
Post a Comment