File: grompplog2top

package info (click to toggle)
gromacs 4.5.5-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 79,700 kB
  • sloc: asm: 789,508; ansic: 424,578; fortran: 94,172; sh: 10,808; makefile: 2,170; cpp: 1,169; csh: 708; perl: 687; python: 264
file content (32 lines) | stat: -rwxr-xr-x 748 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/csh -f

if ( $#argv < 2 ) then
    set in = grompp.log
    set out = topolout.top
    set program = $0
    echo "usage $program:t $in $out"
    echo "Parses grompp debug logfile into original processed topology file"
else
    set in = $1
    set out = $2
endif

if ( -f $out ) then
    if ( $out:h == $out:t ) then
	set backup = \#$out:t\#
    else
	set backup = $out:h/\#$out:t\#
    endif
    echo "Back Off! I just backed up $out to $backup"
    \mv $out $backup
endif
if ( ! -f $in ) then
    echo "FATAL ERROR: input file $in does not exist"
    exit 1
endif

echo -n "Processing..."
grep -E '(\".*\" : .* :)|(found directive)' $in | sed 's/found directive '\''\(.*\)'\''/[ \1 ]/' | sed 's/\".*\" : .* ://' >! $out
echo "."

#last line