Sponsored Content
Top Forums UNIX for Advanced & Expert Users About XML file Integrating to a table Post 302319224 by TonyFullerMalv on Sunday 24th of May 2009 05:07:07 PM
Old 05-24-2009
To ensure that the "Attempts" line counter is always "1" and the "Successful Attempts" line counter is always "2" you could run each xml file through the following script before importing it into Oracle:

Code:
 sed -e '/Attempts/s/mt p="2"/mt p="1"/' -e '/Successful Attempts/s/mt p="1"/mt p="2"/'   inputfile.xml > outputfile.xml

Example run thorugh:
Code:
$ cat inputfile.xml
<mt p="1">Attempts</mt>
<mt p="2">Successful Attempts</mt>
<mt p="2">Attempts</mt>
<mt p="1">Successful Attempts</mt>
<mt p="2">Attempts</mt>
<mt p="2">Successful Attempts</mt>
<mt p="1">Attempts</mt>
<mt p="1">Successful Attempts</mt>
$ sed -e '/Attempts/s/mt p="2"/mt p="1"/' -e '/Successful Attempts/s/mt p="1"/mt p="2"/' inputfile.xml > outpufile.xml
$ cat outpufile.xml
<mt p="1">Attempts</mt>
<mt p="2">Successful Attempts</mt>
<mt p="1">Attempts</mt>
<mt p="2">Successful Attempts</mt>
<mt p="1">Attempts</mt>
<mt p="2">Successful Attempts</mt>
<mt p="1">Attempts</mt>
<mt p="2">Successful Attempts</mt>
$

 

8 More Discussions You Might Find Interesting

1. Programming

about wave file integrating.

Now I have two wave file(*.wav) at Tru64 Unix machine. I want to make a new wave file including the two wave file. how I should finish this programmer. If you know, can you give me the format of the wave file(*.wav) and Sun au file(*.au). Thank you. (1 Reply)
Discussion started by: livic
1 Replies

2. Shell Programming and Scripting

How to export table data to xml file?

Hi , I would like to get some suggestion from the experts. My requirement is to export oracle table data as an xml file. Any unix/linux tools, scripts available? Regards, (2 Replies)
Discussion started by: LinuxLearner
2 Replies

3. Shell Programming and Scripting

How to add the multiple lines of xml tags before a particular xml tag in a file

Hi All, I'm stuck with adding multiple lines(irrespective of line number) to a file before a particular xml tag. Please help me. <A>testing_Location</A> <value>LA</value> <zone>US</zone> <B>Region</B> <value>Russia</value> <zone>Washington</zone> <C>Country</C>... (0 Replies)
Discussion started by: mjavalkar
0 Replies

4. Shell Programming and Scripting

Help required in Splitting a xml file into multiple and appending it in another .xml file

HI All, I have to split a xml file into multiple xml files and append it in another .xml file. for example below is a sample xml and using shell script i have to split it into three xml files and append all the three xmls in a .xml file. Can some one help plz. eg: <?xml version="1.0"?>... (4 Replies)
Discussion started by: ganesan kulasek
4 Replies

5. Shell Programming and Scripting

Comparing delta values of one xml file in other xml file

Hi All, I have two xml files. One is having below input <NameValuePair> <name>Daemon</name> <value>tcp:7474</value> </NameValuePair> <NameValuePair> <name>Network</name> <value></value> </NameValuePair> ... (2 Replies)
Discussion started by: sharsour
2 Replies

6. Shell Programming and Scripting

XML to Table conversion

<title>00000888</title> <name>XYZ</name> <updated>2397-2323</updated> <content>Content</content> <summary>summary12</summary> <title>00000788</title> <name>ABC</name> <updated>99090-09</updated> <content>Content123</content> ... (4 Replies)
Discussion started by: nanduri
4 Replies

7. Shell Programming and Scripting

Splitting a single xml file into multiple xml files

Hi, I'm having a xml file with multiple xml header. so i want to split the file into multiple files. Sample.xml consists multiple headers so how can we split these multiple headers into multiple files in unix. eg : <?xml version="1.0" encoding="UTF-8"?> <ml:individual... (3 Replies)
Discussion started by: Narendra921631
3 Replies

8. Shell Programming and Scripting

Script to load XML file to Oracle table

Experts. I have created a oracle table as below. create table xml_tab ( File_No number , File_content Varchar2(2000), file_type xmltype ); Daily we are receiving many XML files as below. here is our sample xml file. File1 : (7 Replies)
Discussion started by: vasuvv
7 Replies
io_queue_run(2) 						     Linux AIO							   io_queue_run(2)

NAME
io_queue_run - Handle completed io requests SYNOPSIS
#include <errno.h> #include <libaio.h> int io_queue_run(io_context_t ctx_id); DESCRIPTION
io_queue_run Attempts to read all the events events from the completion queue for the aio_context specified by ctx_id. RETURN VALUES
May return 0 if no events are available. Will fail with -ENOSYS if not implemented. ERRORS
EFAULT iocbs referenced data outside of the program's accessible address space. EINVAL ctx_id refers to an unitialized aio context, the iocb pointed to by iocbs contains an improperly initialized iocb. ENOSYS Not implemented. SEE ALSO
io(3), io_cancel(3), io_fsync(3), io_getevents(3), io_prep_fsync(3), io_prep_pread(3), io_prep_pwrite(3), io_queue_init(3), io_queue_release(3), io_queue_wait(3), io_set_callback(3), io_submit(3), errno(3). Linux 2.4 2009-06-10 io_queue_run(2)
All times are GMT -4. The time now is 06:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy