regex - Regular expression syntax advice needed -
Can someone please advise me what I am doing wrong here:
Sed /&.*?;ss// ' I am trying to remove all but' this text '
lt ; Td rowspan = "2" width = "80" valign = "top" & amp; G; & Amp; #xD; & Amp; Lt; Img src = "http://foo.bar/image.jpeg" / & amp; Gt; & Amp; #xD; & Amp; Lt; / TD & amp; Gt; & Amp; #xD; & Amp; Lt; TD & amp; Gt; & Amp; #xD; This text & amp; #xD; & Amp; #xD; If your search string is static, then you just have a simple Grep < / Code>: grep -o "this text" file.txt Otherwise, you can use sed And match some patterns, try: sed -e's / & amp; * $ $ '' -e '/ ^ $ / d' -e '/ ^ lt; Td / d 'file.txt You may need to include several other expressions such as: -e' / ^ lt; Your data file to remove other undesirable lines in td / d ', if included in it. HH
Comments
Post a Comment