diff --git a/src/tran_excel2utf8.py b/src/tran_excel2utf8.py new file mode 100644 index 0000000000000000000000000000000000000000..a0dbb2f7dfa2ceb5d020bbd6f8a49fcaea457f73 --- /dev/null +++ b/src/tran_excel2utf8.py @@ -0,0 +1,14 @@ +import os +import pandas as pd + + +def main(infile): + outfile = infile.replace(".xlsx", "_result.csv") + df = pd.read_excel(infile, header=None) + # df.to_excel(outfile, header=False, index=False, encoding="utf_8_sig", engine='xlsxwriter') + df.to_csv(outfile, header=False, index=False, encoding="utf_8_sig") + + +if __name__ == "__main__": + infile = 'data/city.xlsx' + main(infile)