We take one line from the file, run it through a perl script, awk - to $(NF-1) to get the value.
In a script we would do;
while true
do
A=`head -1 file`
B=`head -1 file |perl /path/script.pl |awk ' { print $(NF-1) ] '`
if [ B -gt 90 ]
do
sed '/'$A'/d' filein > fileout
done
fi
done
However, by doing this you are reading a file with 5M+ lines once for every line. I am trying to find a way I can run sed once (thus reading the file once) and putting a condition to read the line, parse it with the pl script, awk it, check the value, and whack it if the condition is true.
I was thinking about something along the lines of
sed '/'` A=1 B=0 C=`head -$A file |tail -$B` D=`head -$A file |tail -$B |perl script.pl |awk ' { print $(NF-1) } ' if [ $D -gt 90 ] do echo $C done let A=A+1 let B=B+1 `'/d' filein > fileout
But it hasn't yet.....