Created
May 6, 2018 10:41
-
-
Save ettorerizza/c14cf2b8cc8bb1917df8c38b05172dd4 to your computer and use it in GitHub Desktop.
Function to change the separator in a csv row
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import re | |
| def changeSeparator(value): | |
| regex = re.compile(r'("(?:[^"]|"")*"|[^,"\n\r]*)(,|\r?\n|\r)') | |
| return re.sub(regex, r"\1|||", value) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment