Skip to content

Instantly share code, notes, and snippets.

@xbns
Created June 6, 2019 08:27
Show Gist options
  • Save xbns/1a4ec75c2e4fc44c36fa55a6b9fbe155 to your computer and use it in GitHub Desktop.
Save xbns/1a4ec75c2e4fc44c36fa55a6b9fbe155 to your computer and use it in GitHub Desktop.
#replace text #files
import fileinput
#Read in the file
with open('aws-whitepapers.txt','r') as file:
filedata=file.read()
#Replace the target string
filedata = filedata.replace('//','https://')
#Write the file out again
with open('aws-whitepapers.txt','w') as file:
file.write(filedata)
print('done replacing')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment