I have two text file. The structure of those two file is same. I have a while loop which reads from those two text file at the same time. But both of those two file , first 4 line is not needed. so what i need is, at the very starting of my program the two head will jump to line number 4 of both of those files and then start to read through my while loop. Here is my current code
while read compareFile1 <&3 && read compareFile2 <&4; do
echo $compareFile1
echo $compareFile2
done 3<test1.txt 4<test2.txt
Here is my sample file ..
=== Predictions on test data ===
inst# actual predicted error prediction (id)
1 1:positive 1:positive 0.774 (10001996.txt)
2 1:positive 2:negative + 0.889 (10003432.txt)
3 1:positive 1:positive 1 (10003865.txt)
4 1:positive 1:positive 0.999 (10004065.txt)
5 1:positive 1:positive 0.991 (10004266.txt)
6 1:positive 1:positive 0.999 (10006157.txt)
7 1:positive 1:positive 0.869 (10007003.txt)
8 1:positive 2:negative + 1 (10008447.txt)
9 1:positive 1:positive 0.998 (10009702.txt)
10 1:positive 1:positive 0.994 (10011072.txt)
How can i do this by bash? I am using mac. Thanks.