Sponsored Content
Top Forums Shell Programming and Scripting Parse an XML task list to create each task.xml file Post 302256463 by summer_cherry on Sunday 9th of November 2008 11:15:15 PM
Old 11-10-2008
hi,

below perl code should be ok, pls delete the last and first file of your xml file and run it.

Code:
$/="TASK>";
open FH,"<file";
while(<FH>){
        if(m/id="(.*)"/){
                $file=sprintf("%s.xml",$1);
                open FH1,">$file";
                print FH1 $_;
                close FH1;
        }
}
close FH;

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to parse a XML file using PERL and XML::DOm

I need to know the way. I have got parsing down some nodes. But I was unable to get the child node perfectly. If you have code please send it. It will be very useful for me. (0 Replies)
Discussion started by: girigopal
0 Replies

2. Shell Programming and Scripting

comment and Uncomment single task out of multiple task

I have a file contains TASK gsnmpproxy { CommandLine = $SMCHOME/bin/gsnmpProxy.exe } TASK gsnmpdbgui { CommandLine = $SMCHOME/bin/gsnmpdbgui.exe I would like to comment and than uncomment specific task eg TASK gsnmpproxy Pls suggest how to do in shell script (9 Replies)
Discussion started by: madhusmita
9 Replies

3. Shell Programming and Scripting

How can I parse xml file?

How can I parse file containing xml ? I am sure that its best to use perl - but my perl is not very good - can someone help? Example below contents of file containing the xml - I basically want to parse the file and have each field contained in a variable.. ie. I want to store the account... (14 Replies)
Discussion started by: frustrated1
14 Replies

4. Shell Programming and Scripting

parse xml file

Hello all, Given the following extract from a xml file with multiple <JOB> .... </JOB> entries <JOB APPLICATION="APP" APR="0" AUG="0" AUTHOR="AUT" AUTOARCH="0" CMDLINE="/tmp/test1 %%var" CONFIRM="1" CREATION_DATE="20100430" CREATION_TIME="130739" ... (2 Replies)
Discussion started by: cabrao
2 Replies

5. Shell Programming and Scripting

Create xml file using a content from another xml file

I need to create a xml file(master.xml) with contents from another xml files(children). I have below list of xml files in a temporary location (C:/temp/xmls) 1. child1.xml 2. child2.xml Below is the content of the child1.xml & child2.xml files, child1.xml <root> <emp> ... (3 Replies)
Discussion started by: vel4ever
3 Replies

6. UNIX for Dummies Questions & Answers

Need help how to create a file (xml) list all files from directory

I have more than 10K songs in two directories on a hard drive. I would like to create a file list all of files name then change to .xml extension to upload to iPhone so I have a Karaoke list on my iPhone. I need your help to create a file by using command in Linux. Files names: 0001 More... (4 Replies)
Discussion started by: ggcc
4 Replies

7. UNIX for Dummies Questions & Answers

Parse xml file

HI Guys, Input .XML <xn:MeContext id="L0307"> <xn:ManagedElement id="1"> <xn:VsDataContainer id="1"> <xn:attributes> <xn:vsDataType>vsDataENodeBFunction</xn:vsDataType> ... (3 Replies)
Discussion started by: pareshkp
3 Replies

8. Shell Programming and Scripting

Extract strings from XML files and create a new XML

Hello everybody, I have a double mission with some XML files, which is pretty challenging for my actual beginner UNIX knowledge. I need to extract some strings from multiple XML files and create a new XML file with the searched strings.. The original XML files contain the source code for... (12 Replies)
Discussion started by: milano.churchil
12 Replies

9. Shell Programming and Scripting

Create one xml file from one list of names

Actually I have one list of channels names like: Rai 1 Rai 1 +1HD Rai 1 +2HD Rai 2 Rai 2 +1HD Rai 2 +2HD . . . .From this list of names I need create one new xml file with this structure <channel id="Rai 1"> <display-name lang="it">Rai 1</display-name> <icon... (3 Replies)
Discussion started by: Tapiocapioca
3 Replies

10. UNIX for Beginners Questions & Answers

Need list of input and output parameter of task in a text file, using shell script

//file begin ===== //some code task abcd_; input x; input y,z; //some comment output w; //some comment reg p; integer q; begin //some code end endtask : abcd_ //some code //file end ===== expected output from above... (1 Reply)
Discussion started by: rishifrnds
1 Replies
ADVISE(3PVM)							  PVM Version 3.4						      ADVISE(3PVM)

NAME
pvm_advise() - Controls use of direct task-to-task routing. [In Version 3.2: Replaced by pvm_setopt] SYNOPSIS
C int info = pvm_advise( int route ) Fortran call pvmfadvise( route, info ) PARAMETERS
route Integer advising PVM to set up direct task-to-task links. route options PvmDontRoute 1 Don't allow direct links to this task PvmAllowDirect 2 Allow but don't request direct links PvmRouteDirect 3 Request direct links info Integer returning error status. DESCRIPTION
The routine pvm_advise advises PVM on whether or not to set up direct task-to-task links (using TCP) for all subsequent communication. Once a link is established it remains until the application finishes. If a direct link can not be established because one of the two tasks has requested PvmDontRoute or because no resources are available, then the default route through the PVM daemons is used. pvm_advise can be called multiple times to selectively establish direct links, but is typically set only once near the beginning of each task. PvmAllowDi- rect is the default advise setting. This setting on task A allows other tasks to set up direct links to A. Once a direct link is estab- lished between tasks both tasks will use it for sending messages. pvm_advise returns the error status in info. The performance of direct task-to-task links can be up to a factor of two better than the default route. The draw back is a lack of scalability of the direct links. Some versions of UNIX limit the number of links to no more than 30. EXAMPLES
C: info = pvm_advise( PvmRouteDirect ); Fortran: CALL PVMFADVISE( PVMROUTEDIRECT, INFO ) ERRORS
This error condition can be returned by pvm_advise PvmBadParam giving an invalid route value. SEE ALSO
pvm_setopt(3PVM) 30 August, 1993 ADVISE(3PVM)
All times are GMT -4. The time now is 03:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy