#! /bin/sh # ## Script generate Data files -- by Claudio Rocha # count=1 # ## count must be less or equal of the numbers of lines in file table # while [ $count -le 2380 ] do f1=`sed -n "$count"p table |cut -d" " -f1` f2=`sed -n "$count"p table |cut -d" " -f2` f3=`sed -n "$count"p table |cut -d" " -f3` f4=`sed -n "$count"p table |cut -d" " -f4` f5=`sed -n "$count"p table |cut -d" " -f5` f6=`sed -n "$count"p table |cut -d" " -f6` f7=`sed -n "$count"p table |cut -d" " -f7` echo $f1 : $f2 : $f3 : $f4 : $f5 : $f6 : $f7 # ## Get data from the file table # cat < files ( 2 columns each file ) # tail +9 rsdecode_en.out | cut -c2-4,5-12 > rsdecode_en.out_"$count" # ## Reading the fisrt file and generating the files # col1=`sed -n "$count"p table | cut -d" " -f3` col2=`sed -n "$count"p table | cut -d" " -f4` result1=`expr $col1 - $col2 \* 2` result2=$col1 head -$result1 rsdecode_en.out_$count |cut -c1-3 > first_col_"$count" head -$result2 rsdecode_en.out_$count |cut -c9-11 > second_col_"$count" # ## Delete the firs file # rm rsdecode_en.out_"$count" count=`expr $count + 1` done