I understand, why that would be desirable, but it seems to me like an issue that you can easily solve yourself. Quick python code for that:
#!/usr/bin/env python3
import csv
import sys
from pathlib import Path
TARGET_COLUMNS = [
"Action",
"Time",
"ISIN",
"Ticker",
"Name",
"No. of shares",
"Price / share",
"Currency (Price / share)",
"Exchange rate",
"Result (EUR)",
"Total (EUR)",
"Withholding tax",
"Currency (Withholding tax)",
"Charge amount (EUR)",
"Stamp duty reserve tax (EUR)",
"Notes",
"ID",
"Currency conversion fee (EUR)",
]
def main():
if len(sys.argv) > 1:
infile = open(sys.argv[1], newline="", encoding="utf-8-sig")
else:
infile = sys.stdin
with infile:
reader = csv.DictReader(infile)
if reader.fieldnames is None:
print("Error: CSV has no header row.", file=sys.stderr)
sys.exit(1)
source_columns = reader.fieldnames
added = [c for c in TARGET_COLUMNS if c not in source_columns]
removed = [c for c in source_columns if c not in TARGET_COLUMNS]
if added:
print(
f"Added columns: {', '.join(added)}",
file=sys.stderr,
)
else:
print("Added columns: none", file=sys.stderr)
if removed:
print(
f"Removed columns: {', '.join(removed)}",
file=sys.stderr,
)
else:
print("Removed columns: none", file=sys.stderr)
writer = csv.DictWriter(
sys.stdout,
fieldnames=TARGET_COLUMNS,
lineterminator="\n",
)
writer.writeheader()
for row in reader:
output_row = {col: row.get(col, "") for col in TARGET_COLUMNS}
writer.writerow(output_row)
if __name__ == "__main__":
main()
This will generated exactly the output as requested by the first post. I am not sure, if the output has changed since that post was made, but my columns are named differently and I have others, which would all be removed by the script. But the script tells you what it did, so you can check and adjust the column names in the script.
Usage:
python3 csv-convert.py < from_x_to_y_exported.csv > output.csv
Output:
Added columns: Result (EUR), Total (EUR), Charge amount (EUR), Stamp duty reserve tax (EUR), Currency conversion fee (EUR)
Removed columns: Gross Total, Currency (Gross Total), Currency conversion fee, Currency (Currency conversion fee), Merchant name, Merchant category, Taxes, Currency (Taxes), Net Total, Currency (Net Total), French transaction tax, Currency (French transaction tax)
Given that there is stamp duty, French transaction tax and probably more, such as Italy, there would be a lot of empty columns, so I understand they omit headers that don’t apply. I’d probably do post processing in python anyways. As long as we get all the data somehow, I am happy.