Apr-13-2019, 01:08 PM
You would want something like this:
with open('old_file.txt') as in_file: with open('new_file.txt, 'w') as out_file: for line in old_file: new_file.write(line) if new_file.startswith('@<TRIPOS>MOLECULE'): new_file.write('MOLECULE NAME')
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures