import: fixed the import of tabular files with no header

This commit is contained in:
MercierC
2021-03-16 09:15:48 +13:00
parent bd38449f2d
commit 8833110490

View File

@ -8,7 +8,7 @@ Created on feb 20th 2018
import types import types
from obitools3.utils cimport __etag__ from obitools3.utils cimport __etag__
from obitools3.utils cimport str2bytes
def tabIterator(lineiterator, def tabIterator(lineiterator,
bint header = False, bint header = False,
@ -75,7 +75,7 @@ def tabIterator(lineiterator,
continue continue
else: else:
# TODO ??? default column names? like R? # TODO ??? default column names? like R?
keys = [i for i in range(len(line.split(sep)))] keys = [str2bytes(str(i)) for i in range(len(line.split(sep)))]
while skipped < skip : while skipped < skip :
line = next(iterator) line = next(iterator)