1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-15 01:24:29 +02:00

use universal parser

This commit is contained in:
Kelly Brazil
2019-12-12 15:33:34 -08:00
parent b1162b14d4
commit 8687a772f5

View File

@ -92,8 +92,8 @@ Examples:
... ...
] ]
""" """
import string
import jc.utils import jc.utils
import jc.parsers.universal
def process(proc_data): def process(proc_data):
@ -165,7 +165,12 @@ def parse(data, raw=False, quiet=False):
cleandata = list(filter(None, linedata)) cleandata = list(filter(None, linedata))
if cleandata: if cleandata:
cleandata[0] = cleandata[0].lower()
cleandata[0] = cleandata[0].replace('/', '_')
raw_output = jc.parsers.universal.sparse_table_parse(cleandata)
'''
# find column value of last character of each header # find column value of last character of each header
header_text = cleandata.pop(0).lower() header_text = cleandata.pop(0).lower()
@ -204,6 +209,7 @@ def parse(data, raw=False, quiet=False):
output_line = dict(zip(headers, fixed_line)) output_line = dict(zip(headers, fixed_line))
raw_output.append(output_line) raw_output.append(output_line)
'''
if raw: if raw:
return raw_output return raw_output