Hey guys pretty stuck with this one, I'm supposed format an xml snippet with sed.
This is the original code snippet:
<input>
    <program_name>
            CS
    </program_name>
    <course_name>
                            ART CLASS
    </course_name>
    <instructor>
                John Smith
    </instructor>
</input>
My sed command should format it into the following:
    <input>
        <program_name>CS</program_name>
        <course_name>ART CLASS</course_name>
        <instructor>John Smith</instructor>
  </input>
So far I have the following:
sed -r 'N;N;s/<([a-z_]+)>( *\n* *)([[a-z]+ ?[a-z]+]+)( *\n* *)(<\1>)/<\1>\3\5/g' question.txt
Unfortunately nothing seemed to change, any hints/help are greatly appreciated.
 
    