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

Replace null bytes with '' when encountered in the SF data #21

Merged
merged 1 commit into from
Dec 18, 2017

Conversation

KAllan357
Copy link
Contributor

Depending on the Salesforce field, it is possible to copy/paste or enter NULL bytes \0 into a Salesforce field. When output by the SF API, this data will poison the Python CSV reader with an error:

csv.Error: line contains NULL byte

To fix this error, we can replace the null bytes with empty strings which will allow us to proceed without much modification to the data.

To find null bytes in the data, you can use sed piped to cat: sed -n '/\x0/p' data.csv | cat -v

Copy link
Contributor

@dmosorast dmosorast left a comment

Choose a reason for hiding this comment

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

👍

@KAllan357 KAllan357 merged commit f389b03 into master Dec 18, 2017
@KAllan357 KAllan357 deleted the feature/handle-null-bytes branch December 18, 2017 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants