Question: I have some emails whose content is in html format and I want to save in database in readable format any inputs.

Also i have got emails dumped in a text file and i need to extract data from it.Any inputs .All in java

Answer: 
If you want to remove all HTML tags then take a look at [Jsoup](http://jsoup.org/).
The code below using Jsoup shouldc remove all the html tags and give you plain text.

```
public static String html2text(String html) {
    return Jsoup.parse(html).text();
}

```
You could try removing all tags, leaving just the "text" of the tag content:

```
String text = str.replaceAll("(?m)<.*?>", "");

```

But it's not going to work for all cases.