I have a text file which contain header as well as data section. I want to read the data section but when i wrap the data into 582 character and check the length of data i got different length.please help me to sort out this problem. I am attaching the file
from textwrap import wrap filepath='/media/ibaad/IBAAD/ab010120.18n' with open(filepath) as fp: data=fp.read() # read all the data into single string data1=data.split('END OF HEADER') # split a string into list data_section=data1[1] data_section=data_section[1:] data_section=wrap(data_section,582) print(len(data_section[0])) print(len(data_section[1]))
Attached Files