File: ginp.awk

package info (click to toggle)
xcrysden 1.6.2-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,040 kB
  • sloc: ansic: 36,624; tcl: 33,824; fortran: 6,744; sh: 2,219; makefile: 759; f90: 429; awk: 382; pascal: 30
file content (12 lines) | stat: -rwxr-xr-x 436 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh

cat "$1" | awk '
BEGIN {endline=0; n=1}
($1 ~ /OPTCOOR/ || $1 ~ /OPTBERNY/ || $1 ~ /OPTGEOM/)  && (n != 1) {if ( endline == 0 ) {print "STOP"}
                           endline=1}
($1 ~ /END/)  && (n != 1) {if ( endline == 0 ) {print "STOP"}
                           endline=1}
($1 ~ /STOP/) && (n != 1) {if ( endline == 0 ) {print "STOP"}
                           endline=1}
/a*/ { n++; if ( endline == 0 ) {print} }
'