Difference between revisions of "Grep log file"

From relax wiki
Jump to navigation Jump to search
Line 4: Line 4:
 
<source lang="bash">
 
<source lang="bash">
 
bash ;
 
bash ;
IN=LOGFILE.txt
+
IN=LOGFILE.txt ;
OUT=greplogfile.txt
+
OUT=greplogfile.txt ;
egrep -wi --color 'relax>| model -' LOGFILE.txt > $OUT
+
egrep -wi --color 'relax>| model -' LOGFILE.txt > $OUT ;
 
</source>
 
</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

Revision as of 08:56, 28 August 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

bash ;
IN=LOGFILE.txt ;
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 's/^results.write(/\nresults.write(/' $OUT ;
sed -i 's/^model_selection(/\nmodel_selection(/' $OUT ;
sed -i '0,/spectrum.replicated(/s//\nspectrum.replicated(/' $OUT ;
sed -i '0,/spectrum.read_intensities(/s//\nspectrum.read_intensities(/' $OUT ;

See also

Sed one-liners