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)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki