We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
save the ts column into test.xlsx
ts
ts 2023-10-31 00:39:00
convert test.xlsx to test.csv:
xlsx2csv test.xlsx test.csv --dateformat '%Y-%m-%d %H:%M:%S'
the datetime 2023-10-31 00:39:00 is convert to 2023-10-31 00:39:00, with one second lost(run head test.csv):
2023-10-31 00:39:00
head test.csv
ts 2023-10-31 00:38:59
The text was updated successfully, but these errors were encountered:
I encountered the same problem
before convert, use pandas read excel
pandas
import pandas as pd file_path = "C:\\Users\\acodingcat\\Desktop\\test.xlsx" df = pd.read_excel(file_path)
current dataframe
after convert, use xlsx2csv convert xlsx to csv file
xlsx2csv
from xlsx2csv import Xlsx2csv temp_path = "C:\\Users\\acodingcat\\Desktop\\test.csv" Xlsx2csv(file_path, dateformat="%Y-%m-%d %H:%M:%S", skip_hidden_rows=False, outputencoding="utf-8").convert(temp_path, sheetname="Sheet1") df = pd.read_csv(temp_path)
after convert, some data lost one second accurary
Sorry, something went wrong.
No branches or pull requests
save the
ts
column into test.xlsxconvert test.xlsx to test.csv:
xlsx2csv test.xlsx test.csv --dateformat '%Y-%m-%d %H:%M:%S'
the datetime
2023-10-31 00:39:00
is convert to2023-10-31 00:39:00
, with one second lost(runhead test.csv
):The text was updated successfully, but these errors were encountered: