#! /bin/bash Train=$1 Path=$2 Base=$(basename $Train) Iterations=$(gawk 'END{print NR}' $Train) #echo "Train is "$Train #echo "Base is "$Base #echo "Iterations is "$Iterations TargetEMs="-1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-" #FILENAME,I,LEARNER,SEARCH,HORIZON,RANKER,EVAL,ESTIMATE,ACTUAL,MRE,COST_DRIVERS for ((i=1;i<=$Iterations;i++)) do #echo "i is "$i TestFile=$Path"/data/test/"$Base"."$i TrainFile=$Path"/data/train/"$Base"."$i gawk -f separate.awk -v Target=$i -v TrainFile=$TrainFile -v TestFile=$TestFile $Train #echo "TestFile is at "$TestFile #cat $TestFile #echo "" #echo "TrainFile is at "$TrainFile #cat $TrainFile #echo "" #exit echo -n $Base","$i",LC,N/A,N/A,N/A,N/A," gawk -f "lc.awk" Pass=1 TargetEMs=$TargetEMs $TrainFile Pass=2 Mode=7 TargetEMs=$TargetEMs $TestFile done