I have this huge xml file which contains a lot of comments.
Whats the "best way" to strip out all the comments and nicely format the xml from the linux command line?
you can use tidy
$ tidy -quiet -asxml -xml -indent -wrap 1024 --hide-comments 1 tomcat-users.xml <?xml version='1.0' encoding='utf-8'?> <tomcat-users> <user username="qwerty" password="ytrewq" roles="manager-gui" /> </tomcat-users>
1.4m articles
1.4m replys
5 comments
57.0k users