Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: grep return the entire file not the line which matches

by vikashiiitdm (Novice)
on Aug 03, 2011 at 17:07 UTC ( [id://918332]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://918332]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-25 06:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found