etc..

measure result file sorting script

vfr43edc 2011. 1. 25. 14:55
728x90
echo " " 
echo "*** HSPICE MEASURE FILE SORT PROGRAM by kimjs Ver. 0.2 090720"
echo "*** Usage   : $ current dirctory > measort_mt"
echo "*** !! Warning : Do not abort on running measort_mt! "
echo " "

rm -rf mea.log

NUM_O=`ls hspice.mt* | wc | awk '{print $2}'`
#echo $NUM_O
NUM=`echo $NUM_O - 1 | bc`
echo "### THE NUMBER OF TARGET FILE :" $NUM

cat hspice.mt0 | grep -v "TITLE" | grep -v "VERSION" > hspice.mt0_b
LINE_END_O=`cat hspice.mt0_b | wc | awk '{print $1}'`
#echo $LINE_END
INDEX_NUM=`cat hspice.mt0_b | grep -n "alter#" | awk -F: '{print $1}'`
#echo $INDEX_NUM

INDEX_CHAR_NUM=`cat hspice.mt0_b | head -$INDEX_NUM | wc | awk '{print $2}'`
#echo $INDEX_CHAR_NUM

LINE_END=`expr $LINE_END_O + 2`

cat hspice.mt0_b | head -$INDEX_NUM | tr '\n' ' ' > mea.log

j=0
while [ $j -le $NUM ]
do

rm -rf hspice.mt_tmp

i=2
i=`expr $i + $INDEX_NUM + $INDEX_NUM`
while [ $i -le $LINE_END ]
do
cat hspice.mt"$j" | head -$i | tail -$INDEX_NUM | tr '\n' ' ' >> hspice.mt_tmp
echo " " >> hspice.mt_tmp
i=`expr $i + $INDEX_NUM`

## Decoration ^_^
#echo "hspice.mt$j" > hspice.tmp
#paste -d " " hspice.tmp hspice.mt_tmp > hspice.mt_tmp_v0
#cat hspice.mt_tmp_v0 | head -1

#echo $i
done

echo "" >> mea.log
cat hspice.mt_tmp >> mea.log

j=`expr $j + 1`
done



rm -rf hspice.mt?_?
rm -rf hspice.mt??_?
rm -rf hspice.mt_tmp
rm -rf hspice.tmp
rm -rf hspice.mt_tmp_v0

sed '/^$/d' mea.log > mea.log_1
cp -f mea.log_1 mea.log
rm -rf mea.log_1

echo " ### Error log Report END ### " 
echo " ### Check mea.log file ### "

[출처] measort_mt|작성자 김지석

아따 겨우 찾았네.. 그런데..흠...
나중에 조금 수정해야겠음둥..

단점이.. hspice.mt# 형태를 기준으로 하는듯...
외부에서 넣어주는 걸로 바꿔야 겠다 ㅎ

728x90