Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- word_list = ['Cat','Dog','Bird','Goose','Llama']
- with open("/Users/andrewlintz/Desktop/findreplaceprocess/doc2.txt") as main, open('/Users/andrewlintz/Desktop/findreplaceprocess/doc3.txt', 'w') as new_main:
- counter = 0
- for line in main:
- temp = line
- num = int(math.floor(counter/8))
- counter += 1
- temp = temp.replace("MARKER",word_list[num])
- new_main.write(temp)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement