William> I sometime have to deal with HTML file with messy indentation, William> long lines, etc. You want tidy: tidy.sourceforge.net Also, check the Vaults of Parnassus (www.vex.net/parnassus) for a Python wrapper around tidy. -- Skip Montanaro - skip at pobox.com http://www.mojam.com/ http://www.musi-cal.com/