[gmx-users] pbc atom

chris.neale at utoronto.ca chris.neale at utoronto.ca
Tue Aug 24 22:29:43 CEST 2010


Tsjerk,

Two reasons. First, I simply don't understand awk as well as you do.  
Second, I think that breaking it down into simpler commands linked by  
pipes is better for teaching. If somebody needs help to combine 3 cols  
into a vector distance, then they may copy and paste your solution to  
good effect, but may not learn how to apply that technique to another  
problem as easily as they could when seeing the individual actions  
split by pipes. I could easily be wrong on that, but I'm trying to  
provide an answer to your "why" in case you were asking in earnest.

Aside, thanks again for the awk tips, I appreciate them always and  
they are useful to me.

Chris.

> directly. I think you want this (assuming that cols 5,6,7 give you the
> dx,dy,dz, which I believe that they do):
>
> cat pullx.xvg | grep -v '[#|@]' | awk '{print $1,sqrt($5*$5+$6*$6+$7*$7)}' >
> my.data

Nothing directly harmful of course, but why using three programs for
this? awk will do fine:

awk '/^[^#@]/{print $1,sqrt($5*$5+$6*$6+$7*$7)}' > my.data

Tsjerk

-- 





More information about the gromacs.org_gmx-users mailing list