I have two open source files I've been messing around with, one file is a small macro script I'm working with, second is a txt file filled with commands I'd like to insert in to the first script in a random order within their respective lines. I've managed to come up with this script for searching and replacing the values, but not to insert them in a random order from the second txt file.
def replaceAll(file,searchExp,replaceExp):
for line in fileinput.input(file, inplace=1):
if searchExp in line:
line = line.replace(searchExp,replaceExp)
sys.stdout.write(line)
replaceAll('C:/Users/USERACCOUNT/test/test.js','InterSearchHere', RandomValueFrom2ndTXT)
Any help if greatly appreciated! Thanks in advance!