<p>Hi Chris,</p>
<p>That was indeed what happened with the first version. The &#39;$q&#39; bails out at the last line without editing. <br>
Of course it&#39;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, &quot;Chris Neale&quot; &lt;<a href="mailto:chris.neale@utoronto.ca">chris.neale@utoronto.ca</a>&gt; wrote:<br><br>Shay: that&#39;s a better idea than I had, thanks.<br>

<br>
Tsjerk: that&#39;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 &quot;*.gro&quot; -exec sed -i -e &#39;$q&#39; -e &#39;3,$s/^\(.\{44\}.\).*$/\1/&#39; {} \;<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,  &lt;shayamra at <a href="http://post.tau.ac.il" target="_blank">post.tau.ac.il</a> &lt;<a href="http://lists.gromacs.org/mailman/listinfo/gmx-users" target="_blank">http://lists.gromacs.org/mailman/listinfo/gmx-users</a>&gt;&gt; wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
/ How about:<br>
</blockquote>
/&gt;/ 1. editconf -f file1.gro -o file1.pdb<br>
/&gt;/ 2. editconf -f file1.pdb -o file1_no_vel.gro<br>
/&gt;/ :-)<br>
/&gt;/ PDB contains just coordinates of atoms, so when you convert pdb to gro<br>
/&gt;/ again, you won&#39;t have the velocities.<br>
/&gt;/<br>
/&gt;/ Regards,<br>
/&gt;/ -Shay<br>
/&gt;/<br>
/&gt;/<br>
/&gt;/ Quoting chris.neale at <a href="http://utoronto.ca" target="_blank">utoronto.ca</a> &lt;<a href="http://lists.gromacs.org/mailman/listinfo/gmx-users" target="_blank">http://lists.gromacs.org/mailman/listinfo/gmx-users</a>&gt;:<br>

/&gt;/<br>
/&gt;&gt;/ If you have a directory full of .gro files that contain velocities, and if<br>
/&gt;&gt;/ you don&#39;t need those velocities, then you&#39;re taking up too much space on<br>
/&gt;&gt;/ your drive.<br>
/&gt;&gt;/<br>
/&gt;&gt;/ It&#39;s too bad, but trjconv -novel -f in.gro -o out.gro will still write the<br>
/&gt;&gt;/ velocities to out.gro.<br>
/&gt;&gt;/<br>
/&gt;&gt;/ Here&#39;s a small script to strip the velocities out of a directory of .gro<br>
/&gt;&gt;/ files. If anybody has a better idea of how to do this, then please post ;)<br>
/&gt;&gt;/<br>
/&gt;&gt;/ #!/bin/bash<br>
/&gt;&gt;/ for i in $(ls *.gro); do<br>
/&gt;&gt;/  echo 0|trjconv -f $i -o a.xtc -novel -s $i;<br>
/&gt;&gt;/  echo 0|trjconv -f a.xtc -novel -s $i -o a.gro;<br>
/&gt;&gt;/  mv a.gro $i;<br>
/&gt;&gt;/  rm a.xtc;<br>
/&gt;&gt;/ done<br>
/&gt;&gt;/<br>
/&gt;&gt;/ --<br>
/&gt;&gt;/ gmx-users mailing list    gmx-users at <a href="http://gromacs.org" target="_blank">gromacs.org</a> &lt;<a href="http://lists.gromacs.org/mailman/listinfo/gmx-users" target="_blank">http://lists.gromacs.org/mailman/listinfo/gmx-users</a>&gt;<br>

/&gt;&gt;/ <a href="http://lists.gromacs.org/mailman/listinfo/gmx-users" target="_blank">http://lists.gromacs.org/mailman/listinfo/gmx-users</a><br>
/&gt;&gt;/ Please search the archive at <a href="http://www.gromacs.org/search" target="_blank">http://www.gromacs.org/search</a> before posting!<br>
/&gt;&gt;/ Please don&#39;t post (un)subscribe requests to the list. Use thewww interface<br>
/&gt;&gt;/ or send it to gmx-users-request at <a href="http://gromacs.org" target="_blank">gromacs.org</a>. &lt;<a href="http://lists.gromacs.org/mailman/listinfo/gmx-users" target="_blank">http://lists.gromacs.org/mailman/listinfo/gmx-users</a>&gt;<br>

/&gt;&gt;/ Can&#39;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>
/&gt;&gt;/<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&#39;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&#39;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>