Hi Musa
Perhaps there is a way to do what you want from within LAMMPS. If so, somebody please post a follow-up message. If you have moltemplate installed, you could try using the"exctract_lammps_data.py" script that comes included with it. You can use it to extract only the portions of the data file you want and then stitch them together again using “cat” (see below). Hopefully this will strip out the text you don’t want:
extract_lammps_data.py Header < oldfile > header.txt
extract_lammps_data.py Masses < oldfile > masses.txt
extract_lammps_data.py Atoms < oldfile > atoms.txt
extract_lammps_data.py Bonds < oldfile > bonds.txt
extract_lammps_data.py Angles < oldfile > angles.txt
extract_lammps_data.py Dihedrals < oldfile > dihedrals.txt
extract_lammps_data.py Impropers < oldfile > impropers.txt
cat header.txt > newfile
echo “” >> newfile
echo “Masses” >> newfile
echo “” >> newfile
cat masses.txt >> newfile
echo “” >> newfile
echo “Atoms” >> newfile
echo “” >> newfile
cat atoms.txt >> newfile
echo “” >> newfile
echo “Bonds” >> newfile
echo “” >> newfile
cat bonds.txt >> newfile
echo “” >> newfile
echo “Angles” >> newfile
echo “” >> newfile
cat angles.txt >> newfile
echo “” >> newfile
echo “Dihedrals” >> newfile
echo “” >> newfile
cat dihedrals.txt >> newfile
echo “” >> newfile
echo “Impropers” >> newfile
echo “” >> newfile
cat impropers.txt >> newfile
(If you have “Coeff” sections in your data file, it gets more complicated, because I haven’t tried using “extract_lammps_data.py” on multi-word sections like “Pair Coeffs”. But it probably works if you put quotes around the two words.)
I have never tried running it on a data file created with fix bond/react, so this might not work.
(If this fails, you can always use a text editor, but I guess that is not the solution you want.)
I attempted to type all this on my phone, so I probably made mistakes. I hope this is helpful to somebody.
Cheers
Andrew