Greetings all,
I have an XML file that is being generated from my application, here is a sample of the first tag (That I am trying to remove and display in a list..)
Example-
<tag one= "data" data="1234" updateTime="1300">
<tag one= "data1" data="1234" updateTime="1300">
<tag one= "data2" data="1234" updateTime="1300">
<tag one= "data3" data="1234" updateTime="1300">
My desired output is a text file that looks like this
data
data1
data2
data3
Not sure what the best approach is with this because of the whitespace in tag one. perl/awk/sed?
Opinions would be useful! Thanks much!
Hello jeffs42885,
Could you please try following and let me know if this helps you.
awk '{sub(/.[^"]*"/,"");sub(/".*/,"");print}' Input_file
Thanks,
R. Singh
awk -F'"' '{print $2}' myFile
sed 's/[^"]*"\([^"]*\).*/\1/' myFile
1 Like
Excellent, thank you very much vgersh99. I still need to massage the file a bit but this is a major push in the right direction. thank you!
In the future please post what the file actually looks like, not an idealized depiction, so that we may write code which actually works.
Apologies. Thank you for clarifying. Here is the output that I am now working with. Much better than before!
Keep in mind, this was generated with a part of my utility that generates an XML report.
1.0
http://www.w3.org/2001/XMLSchema-instance
USER1
USER2