Commit e08742ad authored by Lucas Terriel's avatar Lucas Terriel

add bash script to convert XML files to text files

parent e2be9dff
#!/bin/bash
####################################
# Script to convert XML in text files
####################################
# Change xpath value to catch the corresponding content in XML files
XPATH_VALUE = "//newsitem//text()"
# Change path to the directory containing all XML files
PATH_XML_FILES = "./RawText/*.xml"
for file in $PATH_XML_FILES;
do xmllint --xpath "$XPATH_VALUE" "$file" > "${file/%xml/txt}";
done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment