I have a few hundreds of files that has this pattern
@<TRIPOS>ATOM
2 H18 65.2220 Du 1 RES1 0.0000
@<TRIPOS>BOND
1 3 5 ar
@<TRIPOS>SUBSTRUCTURE
among them, some of the files are missing the line after the @<TRIPOS>BOND
and they look like
@<TRIPOS>ATOM
2 H18 65.2220 Du 1 RES1 0.0000
@<TRIPOS>BOND
@<TRIPOS>SUBSTRUCTURE
I'm trying to find all the files in my working directory that are missing the numeric line after the @<TRIPOS>BOND
and move them to another directory. I know this is a simple task, but I am quite new to Linux.
Note: the files vary in length and line numbers, this is why I am "grepping" the line after the @<TRIPOS>BOND
string.
Here's one of my codes, which I was planning to write in a for loop. It doesn't do the job, but I am showing it to show one of my trials.
cat file | grep -A1 '@<TRIPOS>BOND' | awk 'FNR == 2 {print}'
Thank you