I have been looking around, but I cannot seem to find a solid answer to this.
I am using Python3 and I wish to design a JSON to EXcel (not CSV) coverter. I would this would be relatively easy, but it does seem to be giving me issues. It convert the data a bit, but I need to have the data transposed (rows to columns) and have the system generated hash key removed from the resulting excel.
Here is my code so far:
import sys
import pandas as pd
try:
fileInput = sys.argv[1]
fileOutput = sys.argv[2]
except:
print ("\nusage: json-to-excel.py <inputfile.json> <outputfil.xlsx>")
print ("Note: Uses the openpyxl library\n")
sys.exit(1)
pd.read_json(fileInput).to_excel(fileOutput)
Update: The script is working, BUT the data is formatted wrong.
Below is what I mean. The area in brown is the data output, but I want it to be formatted in green (transpose the data and remove the hash keys).