•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 401,597 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,703 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Views: 546 | Replies: 2
![]() |
•
•
Join Date: May 2008
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
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.
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.
Well perl already comes with a module which uses the expat parser, and I find it to be dead easy to work with.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
•
•
Join Date: Oct 2007
Posts: 267
Reputation:
Rep Power: 1
Solved Threads: 26
If you want to make yourself crazy, but learn alot about regexp in the meantime, use a bash script with sed and awk to extrapolate all the info. Basically, you're just looking to match and extract, so it can be done.
Per the post above, you could save yourself a gray hair or two using Perl's mod support for it. Depends on what you want to get out of the experience, I suppose.
, Mike
Per the post above, you could save yourself a gray hair or two using Perl's mod support for it. Depends on what you want to get out of the experience, I suppose.
, Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
Having trouble passing cert exams? Check out How To Pass Any Computer Certification Test!
------------------------------------------------------------------------
Having trouble passing cert exams? Check out How To Pass Any Computer Certification Test!
![]() |
•
•
•
•
•
•
•
•
DaniWeb Shell Scripting Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Previous Thread: Simple awk help
- Next Thread: Giving input



Linear Mode