How to copy particular record with cp command

Hi ,
I have a table of 5 records. I am using FOR condition in this table. Using FOR , I want to copy those particular record into someother file which satisfies the condition. How to use 'cp' command in this situation in UNIX

For Ex

No Prod Price Bar Code
 
1 Colgate 23 34564 col
2 ParkAvenue 118 45456 par
3 Cadbury 15 12357 cad
4 Lipton 23 56234 lip
5 Iodex 09 32334 Iod 

Now , using FOR command , I want to copy those records whose price >=20 .

for (( i =0 , i>=20, i++)
do 
  cp ?????????? (Help Here!!!! )
done

you can use awk..

awk '$3>=20{print}' inputfile > outputfile

Some observations.,

  1. Put the code in CODE tags for better visibility

  2. cp is not intended for copying particular records, refer, man cp -> cp(1): copy files/directories - Linux man page

$ whatis cp
cp (1)               - copy files and directories

awk '$3>=20{print}' inputfile > outputfile

This is not giving the required output. Infact, this is adding "20" figure in the table as a sepeare column.

I want only.

                   1 Colgate        23     34564    col
                   2 ParkAvenue 118     45456    par
                   4 Lipton          23     56234    lip

rows in my final answer , since price of these product is greater than (>=20)

Also you can't use the "for" construct like that. That is for iterations.

while read no prod price bar code; do
  if [ $price -ge 20 ]; then
    echo $no $prod $price $bar $code
  fi
done < inputtable > someotherfile

Hi.

The awk solution given works fine. When you say something doesn't work, it helps if you show what you did and the result.

awk '$3>=20' file1
1 Colgate 23 34564 col
2 ParkAvenue 118 45456 par
4 Lipton 23 56234 lip