i am new to programming/macroing,etc and i would like to do this. Should i use word 2007 or Python or something else? i have only those two things currently.
or
A simple Python script will work:
template = """hello how are you ref={}
ofdifaoididpodvjakjeoijknvkln
ikvnoivwoeij,vn,nviojv
nkavjoiewgkjvlkaior
"""
replace = [
876191, 11166524, 1117225, 1116953, 798993,
793519, 1116737, 1116691, 1116364, 1115635,
909014, 760195, 689981, 604787, 1116217,
1104482, 869990, 886290, 1115893]
print ''.join([template.format(r) for r in replace])
Which will display:
hello how are you ref=876191
ofdifaoididpodvjakjeoijknvkln
ikvnoivwoeij,vn,nviojv
nkavjoiewgkjvlkaior
hello how are you ref=11166524
ofdifaoididpodvjakjeoijknvkln
ikvnoivwoeij,vn,nviojv
nkavjoiewgkjvlkaior
hello how are you ref=1117225
ofdifaoididpodvjakjeoijknvkln
ikvnoivwoeij,vn,nviojv
nkavjoiewgkjvlkaior
.
.
.
and so on.
If you would like to write the output directly to a text file, the following will work:
with open('output.txt', 'w') as f_output:
f_output.write(''.join([template.format(r) for r in replace]))
If you would also like to read the numbers from a text file, use the following:
with open('numbers.txt', 'r') as f_input, open('output.txt', 'w') as f_output:
for number in f_input:
f_output.write(template.format(number.strip()))