Milhouse Van Houten
2005-11-15 18:43:08 UTC
I use an application which generates .xml files containing <date> lines
formatted like:
<date>20050911</date>
What I'd like to do is make them more readable by adding dashes like:
<date>2005-09-11</date>
That should be a one-liner in sed, but I'm new to it and can't make it work.
Anyone know how?
The only additional factor I have is that occasionally there are also <date>
lines like this, which I want ignored (of course):
<date>1997</date>
All lines that aren't <date> lines should also be ignored.
Thanks for any help
formatted like:
<date>20050911</date>
What I'd like to do is make them more readable by adding dashes like:
<date>2005-09-11</date>
That should be a one-liner in sed, but I'm new to it and can't make it work.
Anyone know how?
The only additional factor I have is that occasionally there are also <date>
lines like this, which I want ignored (of course):
<date>1997</date>
All lines that aren't <date> lines should also be ignored.
Thanks for any help