![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| reading from stdin in a shell script | mmesford | Shell Programming and Scripting | 4 | 07-04-2009 03:28 AM |
| file reading through shell script | Dip | Shell Programming and Scripting | 4 | 10-21-2008 11:10 PM |
| reading XML datas via Shell Script | freepal | Shell Programming and Scripting | 1 | 02-08-2008 11:52 AM |
| reading command output from shell script | sri b | Shell Programming and Scripting | 4 | 11-16-2006 12:52 AM |
| Reading a table in a shell script | luiscarvalheiro | Shell Programming and Scripting | 13 | 08-10-2006 07:16 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi,
Iam new to shell scripting.I have below urgent requirement I want to read attributes (transaction,documentmode) in xml tag with shell scripting and create a filename with these attribues Xml : <PURCHASE_10 partner="food" version="1.50" timestamp="2009-03-10T09:56:55" transaction="PURCHASEORDER" document_mode="abc"> </PURCHASE_10> output : PURCHASEORDER_abc.xml Ur help is appreciated Thanks. |
|
||||
|
Code:
while(<DATA>){
if(/.*transaction="([^"]*)".*document_mode="([^"]*)".*/){
print "$1_$2.xml\n";
}
}
__DATA__
<PURCHASE_10 partner="food" version="1.50" timestamp="2009-03-10T09:56:55" transaction="PURCHASEORDER" document_mode="abc">
</PURCHASE_10>
|
|
||||
|
Thanks a lot panyam.Its working as expected.
-----Post Update----- Hi How to capture the xml tag attribute value into a variable in shell script. Thanks, Sumi -----Post Update----- Hi How to capture the xml tag attribute value into a variable in shell script. Thanks, Sumi -----Post Update----- Hi, How to capture the xml tag attribute value into variable in shell script? Thanks, Sumi |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|