Skip to content

Instantly share code, notes, and snippets.

@ettorerizza
Created May 6, 2018 10:41
Show Gist options
  • Select an option

  • Save ettorerizza/c14cf2b8cc8bb1917df8c38b05172dd4 to your computer and use it in GitHub Desktop.

Select an option

Save ettorerizza/c14cf2b8cc8bb1917df8c38b05172dd4 to your computer and use it in GitHub Desktop.
Function to change the separator in a csv row
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