Hi
I m ashamed to post such question but I can not figure out how to do it.
I have a big XML file , with lots of tag.
One of the line contains this:
What I want to do is to extract "My report Test" and replace the space by underscore , so the expected result is My_report_Test
the beginning of my script looks like this
It's really huggly, that's why I ask you for some hits.
I have the impression that it could be possible to do everything in one line, and not going through intermediate temp files.
I think there is also problems with the [ char in the xml file and it seems that my cut command does like.
I m ashamed to post such question but I can not figure out how to do it.
I have a big XML file , with lots of tag.
One of the line contains this:
Code:
<reportViewSearchPath>CAMID("MYportal Security:u:authid=4184878700")/folder[@name='Blablabl bala']/reportView[@name='My report Test']</reportViewSearchPath>
What I want to do is to extract "My report Test" and replace the space by underscore , so the expected result is My_report_Test
the beginning of my script looks like this
Code:
grep 'reportView\[@name=' /usr/local/../xml/myfile.xml >temp.txt
cut -d']</reportViewSearchPath>' -f2 temp.txt >temp2.txt
Result=$(cut -d'@name=' -f2 temp2.txt)
echo $Result
It's really huggly, that's why I ask you for some hits.
I have the impression that it could be possible to do everything in one line, and not going through intermediate temp files.
I think there is also problems with the [ char in the xml file and it seems that my cut command does like.