cancel
Showing results for 
Search instead for 
Did you mean: 

XML parsing through shell scritps

Former Member
0 Kudos

Hi,

Am new to scripting.

Am trying to figure out whether can i use bash scripting to parse an xml file.

Parsing is not just pulling out information according to the pattern but its more of a generic parsing. I should identify the xml hierarchy and pull of information. It's not a basic parsing stuff. So what you tech guys suggest for this. Will the basic bash scripts be suffice or should i go for expat xml parser or perl parsing or whatever??

Pls suggest some tools and throw some light in this.

Any help is appreciated.

Thanks in advance.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

The xmlstarlet program was designed to both read and transform xml from the shell prompt. It's available at

http://xmlstar.sourceforge.net/

former_member698570
Active Participant
0 Kudos

Hi,

I guess it's quite complicated to parse XML using shell scripts (bash etc.)

If you want to parse XML using a scripting language I suppose you use an adequate library or module available for that scripting language. I prefer PERL.

There is a lot of stuff available for PERL (see search.cpan.org and type XML as value for your search in order to find some modules)

Cheers

Former Member
0 Kudos

Hi Karthik,

WELCOME TO SDN

please check this link

http://www.unix.com/shell-programming-scripting/63821-xml-parsing-through-shell-scritps.html

Best regards,

raam

Former Member
0 Kudos

Shell scripts by themselves may not be adequate for this. You should look in to using AWK, it's better suited for pattern processing.

-RK