Skip to content
New issue

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

fix(result-export): failed to convert CSV file into Excel file #586

Merged
merged 2 commits into from
Oct 23, 2023

Conversation

LuckyPickleZZ
Copy link
Collaborator

What type of PR is this?

type-bug

What this PR does / why we need it:

When export result set into Excel format, and the records contains \t like xxx\txxx, OB-DUMPER will use double quote as escape char because of ODC's setting. So the final form in the file is like ...,"xxx" xxxx",....
But when convert it into .xls format, ODC use org.apache.commons.csv to parse CSV file. It can not parse this record, and would report IOException.
So when export into csv, we use backslash instead of quote. The above record will be translated like ..."xxx\ xxx"..., which common-csv could recognize.

Which issue(s) this PR fixes:

Fixes #457

Special notes for your reviewer:

Additional documentation e.g., usage docs, etc.:


@LuckyPickleZZ LuckyPickleZZ added this to the ODC 4.2.2 milestone Oct 23, 2023
@LuckyPickleZZ LuckyPickleZZ self-assigned this Oct 23, 2023
Copy link
Contributor

@yhilmare yhilmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@yhilmare yhilmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@yhilmare yhilmare merged commit a688421 into dev/4.2.2 Oct 23, 2023
19 checks passed
@yhilmare yhilmare deleted the wenmu_422_fix_export_excel_failed branch October 23, 2023 12:54
yhilmare pushed a commit that referenced this pull request Jan 15, 2024
* use backslash as escape char for Excel format

* set replaceObjectIfExists to true for MIX mode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants