<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Jul 17, 2010, at 6:33 AM, Jean Didier Pie Marechal wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="font-family: monospace; ">Hi everyone,<br><br>I want to write only a part of the reply log in a file. I was trying to use the script you gave to katrina months ago but I have a problem in parsing the reply log text output.<br>If I understand correctly the reply log text is a raw text. I'd like to parse it in "lines" and then only write in the output file a intersting bit, like for example lines that contains "RMSD". I thought it would be enough to split text using the '\n' return character but that does not work. Could you give me a hand please?<span class="Apple-converted-space"> </span><br><br>Best<br><br>JD<br><br>def save_reply_log(path):<br> from chimera import dialogs<br> r = dialogs.find('reply')<br> text = r.text.get('1.0', 'end')<br> f= open(path, 'w')<br> i=text.split("\n")<br> f.close()<br><br>save_reply_log("d:/tmplog.txt")<br></span></span></blockquote><br></div><div>Hi JD,</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>I think your function would be written as:</div><div><br></div><div>def save_reply_log(path):</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>from chimera import dialogs</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>r = dialogs.find('reply')</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>text = r.text.get('1.0', 'end')</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>f = open(path, 'w')</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>for line in text.splitlines():</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if "RMSD" in line:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>print>>f, line</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>f.close()</div><div><br></div><div>--Eric</div><div><br></div><br></body></html>