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
--
--
gmx-users mailing list gmx-users@gromacs.org
http://lists.gromacs.org/mailman/listinfo/gmx-users
Please search the archive at http://www.gromacs.org/search before posting!
Please don't post (un)subscribe requests to the list. Use the
www interface or send it to gmx-users-requ...@gromacs.org.
Can't post? Read http://www.gromacs.org/mailing_lists/users.php