grep command

Hi
I am looking for a way to grep a range of data within a file.
for example, I need to grep any row that has a number between 999 to 10000.

Does anyone know how to do it?

Thanks in advance!

Personally, I'd tackle this with sed and the shell....

Let's assume your input file contains only one numeric value on each line, which may or may not contain text too, e.g.

$ cat > input_file
1
100
500
998
999
1000
2000
there is 4500 on this line
5000
9999
10000
10001
99999

Then, a script such as the following would give you the results you want...

$ cat > extract_it.sh
#!/bin/sh

while read line; do
  value=`echo ${line} | sed 's/^[^0-9]*\([0-9]\{3,5\}\)[^0-9]*$/\1/'`
  if [ "${value}" -ge "999" -a "${value}" -le "10000" ]; then
     echo "${line}"
  fi
done < ./input_file

Cheers
ZB