-
Notifications
You must be signed in to change notification settings - Fork 74
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
Option to escape Excel-unfriendly strings #40
Comments
Hi @MrTemple, Thank you for the suggestion. That is quite a neat feature. I have added tho the backlog. Currently, I am a bit busy with regular work, so I would encourage you to give it a try and implement it yourself, since I don't know when I can get to it, sorry. In any case, thank you for the feedback. |
Thanks @dehesa. Where do you suggest I start? Maybe in And do you think I'd need to add another char to the Also, I haven't contributed to an open source project yet. Is this the general process to follow? https://github.com/firstcontributions/first-contributions |
@MrTemple did you ever implement this? thank you |
@aehlke No, I didn't have time to dig under the hood and make the change the way I'd have liked. For my purposes it was faster to just extend String with an excelSafe property. This has all the escaping that seems necessary for excel. I'm pulling many tens of thousands of very long, complexly-formatted, code-containing issue descriptions from various systems (Jira, Github, etc). These seem to have pretty much the ugliest content you're likely to run into, and this escaping logic seems to wrangle them properly without spilling out of the cell. (@dehesa, if you've got an idea where I can put this in CodableCSV, I could give it a whirl.) Note about the character length, I settled on 1000 kind of randomly because it worked on my version of excel, and I didn't happen to need the extra info in the fields I was pulling from. You may want to experiment with a higher limit. Also the
|
Thanks for the detailed info! I ended up using a different library but it also has this issue so I appreciate this |
Is your feature request related to a problem?
When a csv file contains a string with a leading
-
,+
, or=
, Excel will treat it as a formula field and throw an error.Describe the solution you'd like
Love an option to auto-detect these leading characters and escape them properly with a single leading single-quote
'
.The text was updated successfully, but these errors were encountered: