in reply to Re: grep return the entire file not the line which matches
in thread grep return the entire file not the line which matches

dear monk, thanks for the correction. my en_1000 file is made up of such lines and i need to extract the whole line based upon the id provided.

 <p id=EN--1000-0003-3> The object turned out to be a big meteorite. Uttama was delighted. He had never seen anything like it on sea or land before. Despite its journey in space and stay in water, it had retained its shape and colour.  </p>

Replies are listed 'Best First'.
Re^3: grep return the entire file not the line which matches
by jethro (Monsignor) on Aug 03, 2011 at 17:52 UTC

    You still got the same problem there about which I told you a week ago. "EN--1000-0003-3" is not the same as "EN-1000-0003-3". Don't you see that in file there are two "-" after the EN, whereas in the search string there is only one "-".

    To make it even more obvious:

    EN--1000-0003-3 is not the same as EN-1000-0003-3
Re^3: grep return the entire file not the line which matches
by FunkyMonk (Chancellor) on Aug 03, 2011 at 17:44 UTC
    The example I gave will match the all of the lines that contain the search phrase. Perhaps you should try my example with your data and see what happens.