I have a file that has a oneline header and a long column with values. I want to add a second column with values since 10981 (step = 1) until the end of the file (ommiting the header, of course). The problem is that the script needs a lot of memory and my pc crashes, probably due to the script is not well made (sorry, I am new programming!). The script that I have done is this:
with open ('chr1.phyloP46way.placental2.wigFix', 'w') as file_open:
num = 10981
text = file_open.readlines()
next (text)
for line in text:
num = num + 1
print line.strip() + '\t' + str(num)
As my PC crashes when I run it, I tried to test it in pycharm with the following error, what I have seen is probably due to lack of memory:
Process finished with exit code 137 (interrupted by signal 9: SIGKILL)
Any idea to solve this?
Thank you very much!