Browse Source

fix: Fixed csv file parsing

pull/352/head v2.4.118
chrisr3d 2 years ago
parent
commit
91d6f1baa0
No known key found for this signature in database GPG Key ID: 6BBED1B63A6D639F
  1. 4
      misp_modules/modules/import_mod/csvimport.py

4
misp_modules/modules/import_mod/csvimport.py

@ -206,11 +206,11 @@ def __any_mandatory_misp_field(header):
def __special_parsing(data, delimiter):
return list(line.split(delimiter) for line in csv.reader(io.TextIOWrapper(io.BytesIO(data.encode()), encoding='utf-8')) if line and not line.startswith('#'))
return list(tuple(l.strip() for l in line[0].split(delimiter)) for line in csv.reader(io.TextIOWrapper(io.BytesIO(data.encode()), encoding='utf-8')) if line and not line[0].startswith('#'))
def __standard_parsing(data):
return list(line for line in csv.reader(io.TextIOWrapper(io.BytesIO(data.encode()), encoding='utf-8')) if line and not line[0].startswith('#'))
return list(tuple(l.strip() for l in line) for line in csv.reader(io.TextIOWrapper(io.BytesIO(data.encode()), encoding='utf-8')) if line and not line[0].startswith('#'))
def handler(q=False):

Loading…
Cancel
Save