Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Sorry about not being clear. I could not figure out. Thank you.
My MYFILE looks like: It has two sets of values. Column 3 has A and B IN CHAIN A RESIDUE 1 HAS ENERGY 28.8216 IN CHAIN A RESIDUE 2 HAS ENERGY 24.9274 IN CHAIN A RESIDUE 3 HAS ENERGY 19.0884 IN CHAIN B RESIDUE 1 HAS ENERGY 29.2508 IN CHAIN B RESIDUE 2 HAS ENERGY 28.0677 IN CHAIN B RESIDUE 3 HAS ENERGY 18.4152 My NEWF looks like: It has two sets of values. Last column has A and +B ATOM 1 N MET 1 4.751 25.841 -14.267 1.00 0.00 + A ATOM 2 HT1 MET 1 4.805 25.474 -15.239 1.00 0.00 + A ATOM 3 HT2 MET 1 4.342 26.797 -14.278 1.00 0.00 + A ATOM 21 HN ALA 2 7.312 24.620 -11.539 1.00 0.00 + A ATOM 22 CA ALA 2 6.858 25.683 -9.839 1.00 0.00 + A ATOM 23 HA ALA 2 6.844 26.753 -9.694 1.00 0.00 + A ATOM 24 CB ALA 2 5.754 24.998 -9.007 1.00 0.00 + A ATOM 36 OG1 THR 3 11.141 27.554 -8.457 1.00 93.20 + A ATOM 37 HG1 THR 3 10.623 27.711 -9.249 1.00 0.00 + A ATOM 38 CG2 THR 3 11.584 25.728 -9.911 1.00 91.24 + A ATOM 39 HG21 THR 3 12.484 26.243 -10.310 1.00 0.00 + A ATOM 8104 N MET 1 -6.496 -26.244 -13.291 1.00 0.00 + B ATOM 8105 HT1 MET 1 -6.452 -26.200 -14.329 1.00 0.00 + B ATOM 8106 HT2 MET 1 -5.949 -27.077 -12.992 1.00 0.00 + B ATOM 8123 N ALA 2 -8.788 -26.130 -10.521 1.00 0.00 + B ATOM 8124 HN ALA 2 -9.227 -25.264 -10.749 1.00 0.00 + B ATOM 8125 CA ALA 2 -9.147 -26.653 -9.220 1.00 0.00 + B ATOM 8126 HA ALA 2 -9.475 -27.676 -9.335 1.00 0.00 + B ATOM 8127 CB ALA 2 -7.979 -26.598 -8.218 1.00 0.00 + B ATOM 8133 N THR 3 -11.093 -26.367 -7.736 1.00 86.23 + B ATOM 8134 HN THR 3 -10.807 -27.207 -7.281 1.00 0.00 + B ATOM 8135 CA THR 3 -12.402 -25.826 -7.360 1.00 88.87 + B ATOM 8136 HA THR 3 -12.432 -24.774 -7.602 1.00 0.00 + B The last column values of MYFILE should be copied and repeated in last + but one column of my output. The two sets must be repeated. My output looks like: ATOM 1 N MET 1 4.751 25.841 -14.267 1.00 28.8216 + A ATOM 2 HT1 MET 1 4.805 25.474 -15.239 1.00 28.8216 + A ATOM 3 HT2 MET 1 4.342 26.797 -14.278 1.00 28.8216 + A ATOM 21 HN ALA 2 7.312 24.620 -11.539 1.00 24.9274 + A ATOM 22 CA ALA 2 6.858 25.683 -9.839 1.00 24.9274 + A ATOM 23 HA ALA 2 6.844 26.753 -9.694 1.00 24.9274 + A ATOM 24 CB ALA 2 5.754 24.998 -9.007 1.00 24.9274 + A ATOM 36 OG1 THR 3 11.141 27.554 -8.457 1.00 19.0884 + A ATOM 37 HG1 THR 3 10.623 27.711 -9.249 1.00 19.0884 + A ATOM 38 CG2 THR 3 11.584 25.728 -9.911 1.00 19.0884 + A ATOM 39 HG21 THR 3 12.484 26.243 -10.310 1.00 19.0884 + A ATOM 8104 N MET 1 -6.496 -26.244 -13.291 1.00 29.2508 + B ATOM 8105 HT1 MET 1 -6.452 -26.200 -14.329 1.00 29.2508 + B ATOM 8106 HT2 MET 1 -5.949 -27.077 -12.992 1.00 29.2508 + B ATOM 8123 N ALA 2 -8.788 -26.130 -10.521 1.00 28.0677 + B ATOM 8124 HN ALA 2 -9.227 -25.264 -10.749 1.00 28.0677 + B ATOM 8125 CA ALA 2 -9.147 -26.653 -9.220 1.00 28.0677 + B ATOM 8126 HA ALA 2 -9.475 -27.676 -9.335 1.00 28.0677 + B ATOM 8127 CB ALA 2 -7.979 -26.598 -8.218 1.00 28.0677 + B ATOM 8133 N THR 3 -11.093 -26.367 -7.736 1.00 18.4152 + B ATOM 8134 HN THR 3 -10.807 -27.207 -7.281 1.00 18.4152 + B ATOM 8135 CA THR 3 -12.402 -25.826 -7.360 1.00 18.4152 + B ATOM 8136 HA THR 3 -12.432 -24.774 -7.602 1.00 18.4152 + B

In reply to Re^8: incrementing already existing file by wanttoprogram
in thread incrementing already existing file by wanttoprogram

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2024-04-16 07:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found