Apologies if this has already been covered in this site somewhere, I did try looking but without any success. I am new to the whole XML thing, very late starter, and have a requirement to convert an XML fiule to a CSV fomat. I am crrently working on a Solaris OS. Does anyone have any suggestions,... (2 Replies)
Hi Scripting gurus,
I need to convert following text snippet into csv. please help
Input
heading1 = data1
heading2 = data2
..
..
heading n = data n
heading 1 = data1
..
..
Output
data1,data2,....,data n (3 Replies)
Can any one give the idea on this, please.
I have the following XML file and wants to convert into CSV(comma separated value) format.
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Waveset PUBLIC 'waveset.dtd' 'waveset.dtd'>
<Waveset>
<Object name='ra8736'>
<Attribute name='ADDRESS'... (2 Replies)
Hi
Written some script to convert csv to html but could not add table headers.Below are the errors iam getting
./csv2html | more
+ awk -v border=1 -v width=10 -v bgcolor=black -v fgcolor=white
BEGIN { printf("<table border=\"%d\" bordercolor=\"%s\" width=\"%d\"... (2 Replies)
Hi All,
I will be getting a huge XML file with a lot of records in it. I need to convert it into multiple data files.
SAMPLE XML FILE
<ABSProductCatalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <ProductSalesHierachy>
- <Portfolios>
- <Portfolio productCode="P1">
... (8 Replies)
Hi,
I have an xml file and I want to convert it with awk in to a csv file
Test.xml
<Worksheet ss:Name="Map1">
<Table ss:ExpandedColumnCount="2" ss:ExpandedRowCount="2" x:FullColumns="1"
x:FullRows="1" ss:DefaultColumnWidth="60">
<Row>
<Cell><Data... (6 Replies)
I need to convert below xml code to csv. I searched other posts as well but this post (_https://www.unix.com/shell-programming-scripting/174417-extract-parse-xml-data-statistic-value-csv.html) gives "sed command garbled" error. As of now I have written a long script to do it, but can it be done with... (7 Replies)
I am in need of converting billions of XML into csv file to load data to DB, i have found the below code in perl but not sure why it's not working properly.
CODE:
#!/usr/bin/perl
# Script to illustrate how to parse a simple XML file
# and pick out all the values for a specific element, in... (1 Reply)
Hi,
I am not familiar with shell scripting. Please help to convert xml files to csv files using xsltproc command in bash script. Find the xml sample
<?xml version="1.0"?>
-<Source xmlns="link">
<CompanyCd>DSP</CompanyCd>
<SrcSysCd>DSPS</SrcSysCd>
<CountryCd>45</CountryCd>
... (2 Replies)
Discussion started by: mathina
2 Replies
LEARN ABOUT DEBIAN
template::plugin::xml::xpath
Template::Plugin::XML::XPath(3pm) User Contributed Perl Documentation Template::Plugin::XML::XPath(3pm)NAME
Template::Plugin::XML::XPath - Plugin interface to XML::XPath
SYNOPSIS
# load plugin and specify XML file to parse
[% USE xpath = XML.XPath(xmlfile) %]
[% USE xpath = XML.XPath(file => xmlfile) %]
[% USE xpath = XML.XPath(filename => xmlfile) %]
# load plugin and specify XML text to parse
[% USE xpath = XML.XPath(xmltext) %]
[% USE xpath = XML.XPath(xml => xmltext) %]
[% USE xpath = XML.XPath(text => xmltext) %]
# then call any XPath methods (see XML::XPath docs)
[% FOREACH page = xpath.findnodes('/html/body/page') %]
[% page.getAttribute('title') %]
[% END %]
# define VIEW to present node(s)
[% VIEW repview notfound='xmlstring' %]
# handler block for a <report>...</report> element
[% BLOCK report %]
[% item.content(view) %]
[% END %]
# handler block for a <section title="...">...</section> element
[% BLOCK section %]
<h1>[% item.getAttribute('title') | html %]</h1>
[% item.content(view) %]
[% END %]
# default template block passes tags through and renders
# out the children recursivly
[% BLOCK xmlstring;
item.starttag; item.content(view); item.endtag;
END %]
# block to generate simple text
[% BLOCK text; item | html; END %]
[% END %]
# now present node (and children) via view
[% repview.print(page) %]
# or print node content via view
[% page.content(repview) %]
DESCRIPTION
This is a Template Toolkit plugin interfacing to the XML::XPath module.
All methods implemented by the XML::XPath modules are available. In addition, the XML::XPath::Node::Element module implements
present($view) and content($view) methods method for seamless integration with Template Toolkit VIEWs. The XML::XPath::Node::Text module
is also adorned with a present($view) method which presents itself via the view using the 'text' template.
To aid the reconstruction of XML, methods starttag and endtag are added to XML::XPath::Node::Element which return the start and end tag for
that element. This means that you can easily do:
[% item.starttag %][% item.content(view) %][% item.endtag %]
To render out the start tag, followed by the content rendered in the view "view", followed by the end tag.
AUTHORS
This plugin module was written by Andy Wardley.
The XML::XPath module is by Matt Sergeant.
COPYRIGHT
Copyright (C) 1996-2006 Andy Wardley. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
Template::Plugin, XML::XPath, XML::Parser
perl v5.8.8 2008-03-01 Template::Plugin::XML::XPath(3pm)