I have about 2000 files that I need lines added to the beginning and end of.
I need these lines at the beginning of each files:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
I also need this to be the last line of each file:
</urlset>
These files are all in the same folder and are all .xml files.
I’m thinking the best and fastest way to do this would be via command line or perl but am really not sure. I’ve seen a few tutorials on doing this but I think all the characters that are in the lines I need inserted are whats messing it up. Any help would be greatly appreciated. Thanks!
Try doing this in a shell, I only use a glob and a simple concatenation.