Need help reading XML file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need help reading XML file
# 1  
Old 11-16-2005
Need help reading XML file

If someone out there could help me out with this problem. I would really

appreciate it.

My requirement is :Read XML and put data in Test.txt file.Using Shell script(bourn)


My xml file:

<root>

<header>
<HeaderData1>header1</HeaderData1>
<HeaderData2>header2</HeaderData2>
</header>

<detailsRecord>
<DetailRecord1>detail1</DetailRecord1>
<DetailRecord2>detail2</DetailRecord2>
<detailsRecord>

<detailsRecord>
<DetailRecord1>detail3</DetailRecord1>
<DetailRecord2>detail4</DetailRecord2>

<detailsRecord>

<trailer>
<trailer>trailer1</trailer>
</trailer>

</root>





My File Test.txt

Header Record : header1 header2
DetailsRecord : detail1 detail2
DetilsRecord : detail3 detail4
Trailer Record: trailer1



Fixed lengths in Test.txt FILE:

header1(1-7) header2(14-20)
detail1(1-7) detail2( 18-24)
detail3(1-7) detail4( 18-24)
trailer(1-7)






I can't use whitespace as a delimiter.


Thanks you guys very much,
I really appreciate it.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Programming

How to write in other language in text/xml file by reading english text/xml file using C++?

Hello Team, I have 2 files.one contains english text and another contains Japanese. so i have to read english text and replace the text with Japanesh text in third file. Basically, I need a help to write japanese language in text/xml file.I heard wstring does this.Not sure how do i write... (2 Replies)
Discussion started by: SA_Palani
2 Replies

2. UNIX for Dummies Questions & Answers

XML reading and parsing! Please help

See test.xml file attached (7 Replies)
Discussion started by: JulioAmerica
7 Replies

3. UNIX for Dummies Questions & Answers

Reading Xml file and print the values into the text file in columnwise?

hi guys, i want help... Reding XML file and print the values into the text file using linux shell script file as per below xml file <sequence> <Filename>aldorzum.doc</Filename> <DivisionCode>US</DivisionCode> <ContentType>Template</ContentType> <ProductCode>VIMZIM</ProductCode> </sequence>... (4 Replies)
Discussion started by: sravanreddy
4 Replies

4. UNIX for Dummies Questions & Answers

Reading XML file and print the values in the text file using Linux shell script

hi guys, i want help... Reding XML file and print the values into the text file using linux shell script file as per below xml file <sequence> <Filename>aldorzum.doc</Filename> <DivisionCode>US</DivisionCode> <ContentType>Template</ContentType> <ProductCode>VIMZIM</ProductCode> </sequence>... (1 Reply)
Discussion started by: sravanreddy
1 Replies

5. Shell Programming and Scripting

Reading XML file and extracting value

Dear All, I am reading one XML file to extract value from the particular tag:- Sample xml is below:- <KeyValuePairs> <Key>TestString</Key> <Value>Test12_Pollings</Value> </KeyValuePairs> I want to read the value for the KEY tag and there will be multiple key tags :- awk... (4 Replies)
Discussion started by: sharsour
4 Replies

6. Shell Programming and Scripting

Reading XML and replacing a string

Hi All, My thanks in advance for you guys reading this and for any posts. I'm having 100 XML files, I need script which replace a specific string. It must be incrementing in 100 xml files.. Sample XML files: <hwIPHostName type="attrib">DEMO1</hwIPHostName> I need Demo1 to be... (4 Replies)
Discussion started by: karty2129
4 Replies

7. Shell Programming and Scripting

Reading XML data in a FLAT FILE

I have a requirement to read the xml file and split the files into two diffrent files in Unix shell script. Could anyone please help me out with this requirement. Sample file --------------- 0,<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Information... (3 Replies)
Discussion started by: kmanivan82
3 Replies

8. Shell Programming and Scripting

Reading only particular TAG from XML

Hi, I have an XML file with following structure. Between following tags I have pipedelimited records with newline characters (Data1|1|2|3) <!]> I need to read the data between above tags so that my output is a flat file with pipedelimited records. <BOS> <Header> <TTC>ABC</TTC> ... (9 Replies)
Discussion started by: dsrookie
9 Replies

9. Shell Programming and Scripting

Reading filenames with extension .xml

Hi, I want to write a script to read all the filenames with extension .xml in a directory and pass the name of the file, one by one, to another function. Please help me out. Regards. Saurabh (3 Replies)
Discussion started by: bhalotias
3 Replies
Login or Register to Ask a Question
DH_INSTALLXMLCATALOGS(1)					     Debhelper						  DH_INSTALLXMLCATALOGS(1)

NAME
dh_installxmlcatalogs - install and register XML catalog files SYNOPSIS
dh_installxmlcatalogs [debhelper options] [-n] DESCRIPTION
dh_installxmlcatalogs is a debhelper program that installs and registers XML catalog files. It complies with the Debian XML/SGML policy. The file debian/package.xmlcatalogs lists the local XML catalog files to be installed per package as well as the XML entities in those local XML catalog files that are to be registered in the XML catalog system. The local XML catalog file entries in that file should be of the form "local;source;dest", where the verbatim "local" indicates this is an entry for a local XML catalog file, "source" indicates where the local XML catalog resides in the source tree, and "dest" indicates the destination location for the local XML catalog under the package build area. "dest" should start with /usr/share/xml/. The entries for the XML entities to be registered in the package XML catalog file should be of the form "package;type;id;catalog", where the verbatim "package" indicates this is an entry for an XML entity to be registered in the package XML catalog file, "type" indicates the XML entity type (public, system, uri), "id" indicates the XML entity id, and "catalog" indicates the local XML catalog file. The entries for the XML entities to be registered in the root XML catalog file should be of the form "root;type;id", where the verbatim "root" indicates this is an entry for an XML entity to be registered in the root XML catalog file, "type" indicates the XML entity type (public, system, uri), and "id" indicates the XML entity id. If an entry for is to be registered identically in the root catalog and the package catalog file, you can use the form "root-and-package;type;id;catalog", where the verbatim "root-and-package" indicates this is an entry for an XML entity to be registered in both the root and package XML catalog files, "type" indicates the XML entity type (public, system, uri), "id" indicates the XML entity id, and "catalog" indicates the local XML catalog file. XML entity types are described in update-xmlcatalog(8). Using the "root" or "package" commands, a type of "public" will general "delegatePublic" statements in the applicable catalog file. Generally you will want to use the types "public" for any formal public identifiers, and "system" for any files on the local filesystem or URLs. "uri" is only used for non-local files which are not part of the external document subset, e.g., they are not used for entities or DTDs. dh_installxmlcatalogs automatically adds maintainer script snippets for the registration and unregistration of the listed XML entities in the XML catalog system (unless -n is used). A dependency on the xml-core package will be added to "${misc:Depends}", so be sure to use that variable in the file debian/control. See dh_installdeb(1) for an explanation of Debhelper maintainer script snippets. OPTIONS
-n, --noscripts Do not modify postinst/postrm/prerm scripts. NOTES
Note that this command is not idempotent. "dh_clean -k" should be called between invocations of this command. Otherwise, it may cause multiple instances of the same text to be added to maintainer scripts. SEE ALSO
debhelper(7) /usr/share/doc/xml-core/ AUTHOR
Ardo van Rangelrooij <ardo@debian.org> Adam Di Carlo <aph@debian.org> perl v5.10.0 2008-10-14 DH_INSTALLXMLCATALOGS(1)