Quantcast
Channel: Identify empty xml files? - Unix & Linux Stack Exchange
Browsing latest articles
Browse All 3 View Live

Answer by RomanPerekhrest for Identify empty xml files?

to identify and write all xml file names which are empty to a text file for reporting purpose find + xmlstarlet solution: find . -type f -name "*.xml" -exec bash -c \ 'v=$(xmlstarlet sel -t -i...

View Article


Answer by Gilles Quenot for Identify empty xml files?

Try this using xmllint with a xpath expression : #!/bin/sh for xml in *.xml; do bool=$(xmllint --xpath 'count(//*)=1 and string-length(//*[1])=1' "$xml") if [ $bool = true ]; then echo "$xml" >>...

View Article


Identify empty xml files?

I have a requirement to identify and write all xml file names which are empty to a text file for reporting purpose. Empty , here means the xml file has the usual header tag <?xml version="1.0"...

View Article
Browsing latest articles
Browse All 3 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>