extract number range from a file

Hi Everyone,

a.txt

1272904667;1272904737;1
1272904747;1272904819;1
1272904810;1272904857;1
1272904889;1272904926;1
1272905399;1272905406;1
1272905411;1272905422;1

if i want to get the record, when the a.txt 1st field is between 1272904749 and 1272905399, any simple way by using awk, or perl?

Thanks

Hi,

try with:

awk -F";" '{if ($1>1272904749 && $1<1272905399) print}' IN_FILE
1 Like