The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
plz help me in writing a script Renjesh SUN Solaris 3 03-24-2008 08:31 AM
Help needed for writing a script sriram_1978 Shell Programming and Scripting 4 12-06-2007 04:10 AM
Writing the script jess_t03 Shell Programming and Scripting 1 10-10-2007 06:17 AM
plz help in writing awk script LAKSHMI NARAYAN Shell Programming and Scripting 3 07-14-2007 04:06 AM
Help needed to test CorneliOS open source software on different platforms joskirps UNIX for Advanced & Expert Users 0 06-20-2007 04:39 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-24-2007
naren_0101bits naren_0101bits is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 9
Question Help needed in writing awk script for xml source

Hi, i am not able to get an approach for converting xml file to flat file using awk programming. Can anyone help me out.

The input xml is like this:

<outer>
<field1>one</field1>
<field2>two</field2>
<field3>three<Error Code=777 Description=12345/></field3>
<field4>four</field4>
</outer>


Expected output is like this:

field1 field2 field3 field4 Code Description
one two three four 777 12345

The field1, field2, ... should not be hardcoded.

Thanks in advance,
Naren
  #2 (permalink)  
Old 09-24-2007
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,958
Not sure if this is a similar post to this ?

http://www.unix.com/unix-for-dummies...flat-file.html
  #3 (permalink)  
Old 09-24-2007
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,798
Quote:
Originally Posted by matrixmadhan View Post
Not sure if this is a similar post to this ?

http://www.unix.com/unix-for-dummies...flat-file.html
Yes, both the posts looks very similar and they come from the same IP. I have a feeling it is a homework question.

Closing this thread and the other one.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:39 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0