title: how to extract bold words and normal text separately from text document using apache tika
body: <p>i am using apache tika for parsing word document.but it is extracting whole content and i want to extract header separately and normal text seperately.here is the code i am trying.</p>
  
  <pre><code>    public class TextParser 
      {
      public static void main(String[] args) throws IOException,SAXException, 
      TikaException {
  
        //detecting the file type
        BodyContentHandler handler = new BodyContentHandler();
       // System.out.println("output"+handler.toString());
        Metadata metadata = new Metadata();
        FileInputStream inputstream = new FileInputStream(new File("C:\\TikaExamples\\example.txt"));
        ParseContext pcontext=new ParseContext();
  
        //Text document parser
        TXTParser  textParser = new TXTParser();
        textParser.parse(inputstream, handler, metadata,pcontext);
        System.out.println("Contents of the document:" + handler.toString());
        System.out.println("Metadata of the document:");
        String[] metadataNames = metadata.names();
  
        for(String name : metadataNames) {
           System.out.println(name + " : " + metadata.get(name));
        }
     }
     }
  </code></pre>