Difference between revisions of "Grep log file"

From relax wiki
Jump to navigation Jump to search
Line 2: Line 2:
 
First we find which commands relax has performed, and separate into the different fitting models.<br>
 
First we find which commands relax has performed, and separate into the different fitting models.<br>
 
We also just make some line space and important points
 
We also just make some line space and important points
tcsh ;
+
<source lang=bash">
set IN=LOGFILE.txt
+
tcsh ;
set OUT=greplogfile.txt
+
set IN=LOGFILE.txt
egrep -wi --color 'relax>| model -' LOGFILE.txt > $OUT
+
set OUT=greplogfile.txt
 +
egrep -wi --color 'relax>| model -' LOGFILE.txt > $OUT
 +
</source>
 
Then we replace instances of '''relax> ''' with empty, and comment out the model line
 
Then we replace instances of '''relax> ''' with empty, and comment out the model line
sed -i "s/relax> //"$OUT ;
+
<source lang=bash">
sed -i 's/^- /\n#- /' $OUT ;
+
sed -i "s/relax> //"$OUT ;
sed -i 's/^minimise(/\nminimise(/' test ;
+
sed -i 's/^- /\n#- /' $OUT ;
sed -i '0,/spectrum.replicated(/s//\nspectrum.replicated(/' test ;
+
sed -i 's/^minimise(/\nminimise(/' $OUT ;
 +
sed -i '0,/spectrum.replicated(/s//\nspectrum.replicated(/' $OUT ;
 +
</source>
  
 
== See also ==
 
== See also ==

Revision as of 13:38, 13 June 2013

Grep the log file for commands

First we find which commands relax has performed, and separate into the different fitting models.
We also just make some line space and important points

tcsh ;
set IN=LOGFILE.txt
set OUT=greplogfile.txt
egrep -wi --color 'relax>| model -' LOGFILE.txt > $OUT

Then we replace instances of relax> with empty, and comment out the model line

sed -i "s/relax> //"$OUT ;
sed -i 's/^- /\n#- /' $OUT ;
sed -i 's/^minimise(/\nminimise(/' $OUT ;
sed -i '0,/spectrum.replicated(/s//\nspectrum.replicated(/' $OUT ;

See also

Sed one-liners