首页 > 解决方案 > How to find precise numbers in line and print the line with them?

问题描述

I have a file with table:

1.59    29.206  0.203728775894573   4   60
1.6537  355.592 0.212182437055971   4   0
1.59    29.206  0.203728775894573   3   45

I am trying to print the line with numbers 4 0.

I tried to use this code.

    t=4
    v=0
    line=$(grep -F "$t" prediction.txt  | grep -F "$v")
    echo -e $line

标签: bash

解决方案


尝试这个:

awk '$4 == 4 && $5 == 0' prediction.txt

推荐阅读