Text in input file is like this
<title> <band height="21" isSplitAllowed="true" > <staticText> <reportElement x="1" y="1" width="313" height="20" key="staticText-1"/> <box></box> <textElement> <font fontName="Arial" pdfFontName="Helvetica-Bold" size="14" isBold="true" isUnderline="true"/> </textElement> <text><![CDATA[4) Computation of Tier I and Tier II Capital :]]></text> </staticText> </band> </title>
Output file should have:
4) Computation of Tier I and Tier II Capital :
The file has many <title>
and [CDATA]
tags. but I want to copy text which is under tag <title>
under <CDATA>
and save its output in another file.
grep '4) Computation of Tier I and Tier II Capital :' input.txt > output.txt
:/ You'll have to give us more specific details about what strings are allowed, and what are not. Perhaps give us an example of what is not allowed, and a few that are allowed.cat file | grep -rin \* | cut -d \* -f 3