Skip to content
Snippets Groups Projects
Commit 1e5181a7 authored by jacques.grelet_ird.fr's avatar jacques.grelet_ird.fr
Browse files

skip if list p is empty, case of empty line

parent a46c3855
No related branches found
No related tags found
No related merge requests found
......@@ -430,6 +430,10 @@ class Profile:
p = line.strip().split(self.__separator)
logging.debug(f"line split: {p}")
#logging.debug(f"line end: {p[-1]}")
# skip if list p is empty, case of empty line
if not p:
continue
# skip to next line in file when skipLineWith is defined
if 'skipLineWith' in cfg[device.lower()]:
......
......@@ -285,13 +285,15 @@ class Trajectory:
sql['LONGITUDE'] = longitude
#sql['lon'] = tools.Dec2dmc(float(longitude),'E')
#print(f"Line: {line} separator: {self.__separator}")
# now, extract and process all data
# split the line, remove leading and trailing space before
p = line.strip().split(self.__separator)
#print(p)
logging.debug(f"line split: {p}")
# skip if list p is empty, case of empty line
if not p:
continue
# insert data from list p with indice hash[key]
for key in self.keys:
if key == 'ETDD':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment