Created
June 6, 2019 08:27
-
-
Save xbns/1a4ec75c2e4fc44c36fa55a6b9fbe155 to your computer and use it in GitHub Desktop.
#replace text #files
This file contains 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 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