Skip to content

Instantly share code, notes, and snippets.

@mrhalix
Last active August 1, 2023 12:58
Show Gist options
  • Save mrhalix/4be647fe4bcfb6af92e2b605b0e2653f to your computer and use it in GitHub Desktop.
Save mrhalix/4be647fe4bcfb6af92e2b605b0e2653f to your computer and use it in GitHub Desktop.
Replace newlines in gitlab issue exported file's description, mostly needed by UTF-8 people
import re
file = open("issues.csv", "r")
text = file.read()
for i in re.findall(r'\".*?\"', text, flags=re.DOTALL):
text = text.replace(i, i.replace("\n", "'----'")) # replace \n with '----' in issue title and description
newf = open('issues-fixed.csv', 'w')
newf.write(text)
newf.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment