mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
json-like output
This commit is contained in:
parent
4463592c7a
commit
7479aeec98
@ -1098,18 +1098,14 @@ def write_normalized(guid_utils: TskGuidUtils, output_file, db_conn, table: str,
|
|||||||
row_dict = row_masker.normalize(guid_utils, row_dict)
|
row_dict = row_masker.normalize(guid_utils, row_dict)
|
||||||
|
|
||||||
if row_dict is not None:
|
if row_dict is not None:
|
||||||
# NOTE: This is an alternate approach to representing values as json-like lines
|
# show row as json-like value
|
||||||
# entries = []
|
entries = []
|
||||||
# for column in column_names:
|
for column in column_names:
|
||||||
# value = get_sql_insert_value(row_dict[column] if column in row_dict and row_dict[column] else None)
|
value = get_sql_insert_value(row_dict[column] if column in row_dict and row_dict[column] else None)
|
||||||
# if value:
|
if value is not None:
|
||||||
# entries.append((column, value))
|
entries.append((column, value))
|
||||||
# insert_values = ", ".join([f"{pr[0]}: {pr[1]}" for pr in entries])
|
insert_values = ", ".join([f"{pr[0]}: {pr[1]}" for pr in entries])
|
||||||
# insert_statement = f"{table}: {{{insert_values}}}\n"
|
insert_statement = f"{table}: {{{insert_values}}}\n"
|
||||||
# output_file.write(insert_statement)
|
|
||||||
|
|
||||||
values_statement = ",".join(get_sql_insert_value(row_dict[col]) for col in column_names)
|
|
||||||
insert_statement = f'INSERT INTO "{table}" VALUES({values_statement});\n'
|
|
||||||
output_file.write(insert_statement)
|
output_file.write(insert_statement)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user