If u want to maintain tags in a file,why don't u use xml file?If u use xml,u canuse parser(dom or sax parser) to retrieve the details.If u use flat,it is verydifficult to retrieve the details.