i am trying to grep three fields of a file in to another file but i am not getting the required output
my requirement is: i hav following fields in a file as: 1.query 2.lang= 3.ip address 4.browser etc.... i want to grep only two fields in to another file to get the output. this must be done with out giving the field names it worked well for two fields with the command: grep "lang=" filename | grep -o -P "query=" > output filename But while i was trying to grep 3 fields to another output file its not working.. grep "lang=" filename | grep -o -P "query=" | grep -o -P "ipaddress" > output filename for ip address i gave like this "[0-9]+[.][0-9]+[.][0-9]+[.][0-9] " is there any way to do this thanks in advance.... sudheer
