[Tutor] Reformatting a one (long) line xml file
adam.jtm30 at gmail.com
Wed Sep 28 22:23:28 CEST 2005
BeautifulSoup <http://www.crummy.com/software/BeautifulSoup/> is a brilliant
module for this kind of thing. Just make an instance of a parser feed() in
the file with file.read() then .prettify()
On 28/09/05, Negroup - <negroup at gmail.com> wrote:
> Hi all, I have an xml file where the tags are all on the same line,
> without any newline. This file is quite big and difficult to read. I'd
> like to format it in a convenient way, using indentation and nesting.
> How to pretty print my content?
> I hope to have explained well enough my problem, differently let me know.
> Thans a lot!
> Tutor maillist - Tutor at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor