<p>Hi Chris,</p>
<p>That was indeed what happened with the first version. The '$q' bails out at the last line without editing. <br>
Of course it's also easy to write a python script doing it, combined with find -exec. </p>
<p>Cheers,</p>
<p>Tsjerk</p>
<p><blockquote type="cite">On Jul 5, 2010 11:57 PM, "Chris Neale" <<a href="mailto:chris.neale@utoronto.ca">chris.neale@utoronto.ca</a>> wrote:<br><br>Shay: that's a better idea than I had, thanks.<br>
<br>
Tsjerk: that's likely as fast as its ever going to get. this is great. I was initially worried that it would mangle the last line of the .gro in a triclinic box definition, but it seems to be ok.<br>
<br>
Thanks all,<br>
Chris.<br>
<br>
<br>
-- original message --<br>
<br>
What about:<br>
<br>
find . -name "*.gro" -exec sed -i -e '$q' -e '3,$s/^\(.\{44\}.\).*$/\1/' {} \;<br>
<br>
Assuming using a format %8.3f for coordinates and a single frame in<br>
the .gro file. Otherwise things will get more complicated.<br>
<br>
Cheers,<br>
<br>
Tsjerk<br>
<br>
On Sun, Jul 4, 2010 at 12:45 AM, <shayamra at <a href="http://post.tau.ac.il" target="_blank">post.tau.ac.il</a> <<a href="http://lists.gromacs.org/mailman/listinfo/gmx-users" target="_blank">http://lists.gromacs.org/mailman/listinfo/gmx-users</a>>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
/ How about:<br>
</blockquote>
/>/ 1. editconf -f file1.gro -o file1.pdb<br>
/>/ 2. editconf -f file1.pdb -o file1_no_vel.gro<br>
/>/ :-)<br>
/>/ PDB contains just coordinates of atoms, so when you convert pdb to gro<br>
/>/ again, you won't have the velocities.<br>
/>/<br>
/>/ Regards,<br>
/>/ -Shay<br>
/>/<br>
/>/<br>
/>/ Quoting chris.neale at <a href="http://utoronto.ca" target="_blank">utoronto.ca</a> <<a href="http://lists.gromacs.org/mailman/listinfo/gmx-users" target="_blank">http://lists.gromacs.org/mailman/listinfo/gmx-users</a>>:<br>
/>/<br>
/>>/ If you have a directory full of .gro files that contain velocities, and if<br>
/>>/ you don't need those velocities, then you're taking up too much space on<br>
/>>/ your drive.<br>
/>>/<br>
/>>/ It's too bad, but trjconv -novel -f in.gro -o out.gro will still write the<br>
/>>/ velocities to out.gro.<br>
/>>/<br>
/>>/ Here's a small script to strip the velocities out of a directory of .gro<br>
/>>/ files. If anybody has a better idea of how to do this, then please post ;)<br>
/>>/<br>
/>>/ #!/bin/bash<br>
/>>/ for i in $(ls *.gro); do<br>
/>>/ echo 0|trjconv -f $i -o a.xtc -novel -s $i;<br>
/>>/ echo 0|trjconv -f a.xtc -novel -s $i -o a.gro;<br>
/>>/ mv a.gro $i;<br>
/>>/ rm a.xtc;<br>
/>>/ done<br>
/>>/<br>
/>>/ --<br>
/>>/ gmx-users mailing list gmx-users at <a href="http://gromacs.org" target="_blank">gromacs.org</a> <<a href="http://lists.gromacs.org/mailman/listinfo/gmx-users" target="_blank">http://lists.gromacs.org/mailman/listinfo/gmx-users</a>><br>
/>>/ <a href="http://lists.gromacs.org/mailman/listinfo/gmx-users" target="_blank">http://lists.gromacs.org/mailman/listinfo/gmx-users</a><br>
/>>/ Please search the archive at <a href="http://www.gromacs.org/search" target="_blank">http://www.gromacs.org/search</a> before posting!<br>
/>>/ Please don't post (un)subscribe requests to the list. Use thewww interface<br>
/>>/ or send it to gmx-users-request at <a href="http://gromacs.org" target="_blank">gromacs.org</a>. <<a href="http://lists.gromacs.org/mailman/listinfo/gmx-users" target="_blank">http://lists.gromacs.org/mailman/listinfo/gmx-users</a>><br>
/>>/ Can't post? Read <a href="http://www.gromacs.org/mailing_lists/users.php" target="_blank">http://www.gromacs.org/mailing_lists/users.php</a><br>
/>>/<br>
/<br><font color="#888888">
<br>
-- <br>
gmx-users mailing list <a href="mailto:gmx-users@gromacs.org" target="_blank">gmx-users@gromacs.org</a><br>
<a href="http://lists.gromacs.org/mailman/listinfo/gmx-users" target="_blank">http://lists.gromacs.org/mailman/listinfo/gmx-users</a><br>
Please search the archive at <a href="http://www.gromacs.org/search" target="_blank">http://www.gromacs.org/search</a> before posting!<br>
Please don't post (un)subscribe requests to the list. Use the www interface or send it to <a href="mailto:gmx-users-request@gromacs.org" target="_blank">gmx-users-request@gromacs.org</a>.<br>
Can't post? Read <a href="http://www.gromacs.org/mailing_lists/users.php" target="_blank">http://www.gromacs.org/mailing_lists/users.php</a><br>
</font></blockquote></p>