Hi ,I have this fixed column lenght text file that contains Employee Name,Age and Gender.I want to convert it to xml file.See the details below.Wondering if there is and easy way to achieve it.Please share some idea.

Manjit wrote:
Hi ,I have this text file that contains Employee Name,Age and Sex.I want to convert it to xml file.See the details below.Wondering if there is and easy way to achieve it.Please share some idea.

Well, you don't seem to have a CSV or a fixed-width data, so your only choice would be to look for digits to see when the age comes up. Character.isDigit() can be used for that.

No, there is no Apache API that is built just for your particularly uncommon requirements. Even if there were, figuring out how to make it work on your particular data set will take longer than just doing it yourself.

You will have to write Java code to do it. Which if you make a little effort will probably be around 10-20 lines in size and uses only very basic Java APIs (String, Reader, Writer).