Changes

Jump to navigation Jump to search

Grep log file

304 bytes added, 08:07, 29 August 2013
Then we replace instances of '''relax> ''' with empty, and comment out the model line.
Put this into a file: '''relax_log_to_py.sh'''
<source lang="bash">
#!/bin/tcsh -f set LOGS=`ls -v -d -1 *.log`foreach LOG ( ${LOGS} )set INBNAME=logfile`basename $LOG .txt ;log`set OUT=grep_log_to_commands"grep_${BNAME}.txt ;py"egrep -wi --color 'relax>| model -' $IN LOG > $OUT ;
sed -i "s/relax> //" $OUT ;
sed -i 's/^- /\n#- /' $OUT ;
sed -i '0,/spectrum.replicated(/s//\nspectrum.replicated(/' $OUT ;
sed -i '0,/spectrum.read_intensities(/s//\nspectrum.read_intensities(/' $OUT ;
end
</source>
 
Make it executable
<source lang="bash">
chmod +x relax_log_to_py.sh
</source>
 
End then execute it
<source lang="bash">
tcsh relax_log_to_py.sh
# OR
./relax_log_to_py.sh
</source>
Trusted, Bureaucrats
1,382

edits

Navigation menu