Skip to content

Instantly share code, notes, and snippets.

@n1ckfg
Last active September 5, 2019 15:21
Show Gist options
  • Select an option

  • Save n1ckfg/62ffd5e1dc9edcca3acdcaeaa05e6c56 to your computer and use it in GitHub Desktop.

Select an option

Save n1ckfg/62ffd5e1dc9edcca3acdcaeaa05e6c56 to your computer and use it in GitHub Desktop.
url = "input.csv"
readFile = open(url, "r")
lines = []
for line in readFile:
text = line.split(",")
for i in range(0, len(text)):
if text[i].endswith(".mp3"):
text[i] = text[i].replace("mp3", "ogg") #" ", "_")
lines.append(",".join(text))
readFile.close()
writeFile = open(url, "w")
for line in lines:
writeFile.write(line)
writeFile.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment