I have many .xml files that are encoded in ISO-8859-1, and I want them all in UTF-8.
I figured out the code to convert them individually which is :
iconv -f ISO-8859-1 -t UTF-8 filename.xml > newfilename.xml
and it works fine.
What I want to know is how to write a shell script to automatically clean up all the .xml files in a directory and then replace the old files with the new converted files, but still keeping the same file-name.
I'm new to shell scripting, so help will be much appreciated.
sed -i 's/olddec/newdec/g'
Just insert it into the for loop before the iconv line