Created
September 6, 2016 15:01
-
-
Save Azlirn/367b966fcac477ce438a0f5cd180738a to your computer and use it in GitHub Desktop.
A simple python script to add text to a line in a text file.
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
readfile = raw_input("Please Enter The File You Wish To Read: ") | |
savefile = raw_input("Please Enter The File You Wish To Save: ") | |
read = open(readfile, "r") | |
save = open(savefile, "w+") | |
for line in read: | |
text = " " # Enter what you would like to append here | |
text2 = line | |
newline = text+text2 # You can swap the variables here if you want to add something to the beginning or end of the line. | |
if newline not in save: | |
save.write(newline) | |
print line," ==> ",newline | |
print "\nComplete" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment