Extract values from an XML File


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Extract values from an XML File
# 1  
Old 10-18-2012
Extract values from an XML File

Hi,

I need to capture all the attributes with delete next to it. The source XML file is attached.

The output should contain something like this below:

Attributes = legacyExchangeDN
Action = Delete
Username = Hero Joker
Loginid = joker09
OU = cn=Hero.Joker.ext,ou=LCITY,ou=vision,ou=ABC LCITY,ou=roaming,ou=interactive,ou=users,ou=standard,ou=business,dc=national,dc=core,dc=xyz,dc=co,dc =jp
Exchange version = 2010



Please advise,
Thanks much,
prvnrk
# 2  
Old 10-18-2012
Hi prvnrk,

I'm afraid that you will have to be more specific. I see several names attributes with an operation of delete next to it, not only legacyExchangeDN. And where do you get all other fields from? Do you want us to search those from all your xml file?

Please, put effort to give accurate information and there are more chances for you to get accurate answers.

Regards,
Birei.
# 3  
Old 10-18-2012
Thank you birei for your quick reply.

I have 1 HUGE XML file with Lots of user entries and what I attached is of ONLY ONE user info.

If a User has " <modification name="legacyExchangeDN" operation="delete" /> " then we need to capture that user's remaining details (as per o/p format I gave my post #1) and write it into main output file. For e.g., If we get 10 such users then our o/p file will have 60 lines.

thanks again,
# 4  
Old 10-18-2012
Some questions:

1.- Has each user an <postupdate> entry?
2.- Where do you get user's data? From <mapped>, from <joined> or from anywhere else?
# 5  
Old 10-20-2012
I was told it was SINGLE HUGE XML file to parse but later they confirmed that each user has 1 XML file - So it's very easy for me to implement the script on my own.

I did it and working fine.

Thanks much for your willingness to help me...Cheers!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extract values from xml file script

Hi, please help on this. I want extract values of xml file structure and print in determined way. <ProjectName> --> only appears once <StructList> --> is the top node <Struct> node --> could be more than 1 NameID, STX, STY, PRX, PRY --> appears only 1 time within each <Struct> node... (10 Replies)
Discussion started by: Ophiuchus
10 Replies

2. Shell Programming and Scripting

Extract a value from an xml file

I have this XML file format and all in one line: Fri Dec 23 00:14:52 2016 Logged Message:689|<?xml version="1.0" encoding="UTF-8"?><PORT_RESPONSE><HEADER><ORIGINATOR>XMG</ORIGINATOR><DESTINAT... (16 Replies)
Discussion started by: mrn6430
16 Replies

3. Shell Programming and Scripting

How to extract xml attribute values using awk inline.?

I am trying to extract specific XML attribute values for search pattern <factories.*baseQueueName' from resources.xml. my scripts works ok,, but to extract 3 values this code does echo $line three times, it could be 'n' times. How can I use awk to extract matching pattern values in-line or... (11 Replies)
Discussion started by: kchinnam
11 Replies

4. Shell Programming and Scripting

Comparing delta values of one xml file in other xml file

Hi All, I have two xml files. One is having below input <NameValuePair> <name>Daemon</name> <value>tcp:7474</value> </NameValuePair> <NameValuePair> <name>Network</name> <value></value> </NameValuePair> ... (2 Replies)
Discussion started by: sharsour
2 Replies

5. Shell Programming and Scripting

Extract a particular xml only from an xml jar file

Hi..need help on how to extract a particular xml file only from an xml jar file... thanks! (2 Replies)
Discussion started by: qwerty000
2 Replies

6. Shell Programming and Scripting

Extract data from XML file

Hi , I have input file as XML. following are input data #complex.xml <?xml version="1.0" encoding="UTF-8"?> <TEST_doc xmlns="http://www.w3.org/2001/XMLSchema-instance"> <ENTRY uid="123456"> <protein> <name>PROT001</name> <organism>Human</organism> ... (1 Reply)
Discussion started by: mohan sharma
1 Replies

7. Shell Programming and Scripting

extract a pattern from a xml file

Hello All, I want to write a shell script for extracting a content from a xml file the xml file looks like this: <Variable name="moreAxleInfo"> <type> <Table> <type> <NamedType> <type> <TypeRef... (11 Replies)
Discussion started by: suvendu4urs
11 Replies

8. Shell Programming and Scripting

Extract XML Element Values

I have a rather large file with XML-style content. Each line contains one full XML entry. For example: 1:<Message><DNIS>1234</DNIS><UCID>3456</UCID><TransferGroup>XYZXYZ</TransferGroup></Message> 2:<Message><DNIS>9999</DNIS><UCID>2584</UCID><TransferGroup>ABCABC</TransferGroup></Message>... (1 Reply)
Discussion started by: sharpi03
1 Replies

9. Shell Programming and Scripting

extract a number within an xml file

Hi Everyone, I have an sh script that I am working on and I have run into a little snag that I am hoping someone here can assist me with. I am using wget to retrieve an xml file from thetvdb.com. This part works ok but what I need to be able to do is extract the series ID # from the xml and put... (10 Replies)
Discussion started by: tret
10 Replies

10. Shell Programming and Scripting

How to extract text from xml file

I have some xml files that got created by exporting a website from RedDot. I would like to extract the cost, course number, description, and meeting information. <?xml version="1.0" encoding="UTF-16" standalone="yes" ?> - <PAG PAG0="3AE6FCFD86D34896A82FCA3B7B76FF90" PAG3="525312"... (3 Replies)
Discussion started by: chrisf
3 Replies
Login or Register to Ask a Question