Actually, merge.py takes care of it already. If you use that, the sed command shouldn't be needed.
Did you perhaps mean updating the numbers of molecules in the topology? I don't have an easy solution for that. Unless for the case where you have 1.gro/1.top and 2.gro/2.top, with all moleculetypes in 2.top already #included in 1.top. Then you can do: merge.py 1.gro 2.gro > merged.gro cp 1.top merged.top sed -n '/^ *\[ *molecules/,${/^ *[/d;p}' 2.top >> merged.top On a Mac you may need to install GNU sed for that. Hope it helps, Tsjerk On Dec 27, 2012 1:47 AM, "Kieu Thu Nguyen" <kieuthu2...@gmail.com> wrote: Do you mean that i have to add the line "sed '2s/^.*$/'$(wc -l file.gro)'/' file.gro > out.gro" into the old script merge.py ? On Wed, Dec 26, 2012 at 6:39 PM, Tsjerk Wassenaar <tsje...@gmail.com> wrote: > Hi KT, > > To upda... -- 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/Support/Mailing_Lists/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/Support/Mailing_Lists