hi, i have two molecular dynamics codes, both of them take the same input, but the in different format. let me explain,
for one code (named PinyMD) in the input file, we have,
~atom_def[\atom_typ{na}\atom_ind{ 1 } \mass{14.0067}\charge{ 0.15}] ~atom_def[\atom_typ{na}\atom_ind{ 2 } \mass{14.0067}\charge{ 0.15}] ~atom_def[\atom_typ{cr}\atom_ind{ 3 } \mass{12.0107}\charge{-0.11}] ~atom_def[\atom_typ{cw}\atom_ind{ 4 } \mass{12.0107}\charge{-0.13}] ~atom_def[\atom_typ{cw}\atom_ind{ 5 } \mass{12.0107}\charge{-0.13}] and so on........
and for other code (named NMA) the input file,
1 1 2 1 3 2 4 1 5 1 6 2 7 1 8 1 and so on....
the relation between them is very straightforwd. what appears in PinyMD's input file as "na" might be an integer 1 or "cr" be integer 2 for NMA.
i am trying to write a bash script, which will read in PinyMD input file and convert in the NMA file,
after reading the line, ~atom_def[\atom_typ{na}\atom_ind{ 1 } \mass{14.0067}\charge{ 0.15}] ~atom_def[\atom_typ{cr}\atom_ind{ 2 } \mass{14.0067}\charge{ 0.15}] so on.....
it should echo,
1 1 2 3 so on....
how do i pick up elements 'na' (which i will replace with some integer) and atom_ind{ 1 } which i will replace with 1?