User Tools

Site Tools


scripts:wf2state

usage

  • Copy wf2state to bin directory
  • run with *wf* file name as parameter, example:
 wf2state 006_450.wf1 
  • script generate 006_450.wf1_state file

wf2state:

#! /bin/bash

input=$1
#input="006_450.wf1"

output=$input"_state"

n=`awk '(NR==3){print $1}' $input`
rc=`awk '(NR==4){print $1}' $input`
dx=`awk -v rc=$rc -v n=$n 'BEGIN{print (rc/n)}'`
lines=`cat $input | wc -l`

echo $lines $n $rc $dx

cat $input | tr D e > temp

awk -v lines=$lines -v dx=$dx 'BEGIN{x=0}
(NR>5){
x=x+dx; print x,$1+0.0
x=x+dx; print x,$2+0.0
x=x+dx; print x,$3+0.0 
x=x+dx; print x,$4+0.0
}
' temp > $output
scripts/wf2state.txt · Last modified: 2011/02/18 13:13 (external edit)