Sponsored Content
Full Discussion: XML to flat file in Unix
Top Forums UNIX for Advanced & Expert Users XML to flat file in Unix Post 4854 by PaDDnGtn on Wednesday 1st of August 2001 08:11:34 PM
Old 08-01-2001
If your on a unix platform, I assume you have perl?
type some search strings into the form
at

http://search.cpan.org

there might be a module/package to do what you want.

Stephen
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

XML to flat file

Hi all, can u please help me in converting any given XML file to flat file. thanks in advance. -bali (2 Replies)
Discussion started by: balireddy_77
2 Replies

2. Shell Programming and Scripting

Checking for existence of a flat file in UNIX !

Hi All, I have a requirement where in i need to check for existence of a file and later execute some pmcmd commands related to informatica. I tried many ways but was unsuccessful could you please throw some light. Below are the sample codes i wrote. Example 1: #!/bin/ksh... (4 Replies)
Discussion started by: Ariean
4 Replies

3. Programming

compare XML/flat file with UNIX file system structure

Before i start doing something, I wanted to know whether the approach to compare XML file with UNIX file system structure. I have a pre-configured file(contains a list of paths to executables) and i need to check against the UNIX directory structure. what are the various approches should i use ? I... (6 Replies)
Discussion started by: shafi2all
6 Replies

4. Shell Programming and Scripting

Extracting data into flat file thru unix

Hi, I need to extract a oracle staging table to a flat file thru unix batch process.We are expecting more than 4million records in the table.I know I can do it using "UTL_FILE" .But,since "UTL_FILE" takes a lot of time I am looking for better options.Can any body suggest some better options? ... (3 Replies)
Discussion started by: Beena
3 Replies

5. Shell Programming and Scripting

Converting a flat file in XML

Hello Friends, I am new to UNIX shell scripting. Using bash....Could you please help me in converting a flat file into an XML style output file. Flat file: (Input File entries looks like this) John Miller: 617-569-7996:15 Bunting lane, staten Island, NY: 10/21/79: 60600 The... (4 Replies)
Discussion started by: humkhn
4 Replies

6. Shell Programming and Scripting

To read a flat file containing XML data

I have a file something like this:aaaa.xml content of the file is 0,<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <storeInformation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <s> <BRANCH_NO>3061</BRANCH_NO> <BRANCH_NAME>GREEN EXPRESS</BRANCH_NAME> ... (4 Replies)
Discussion started by: kmanivan82
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

Help with converting XML to Flat file

Hi Friends, I want to convert a XML file to flat file. Sample I/p: <?xml version='1.0' encoding='UTF-8' ?> <DataFile xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' contactCount='4999' date='2012-04-14' time='22:00:14' xsi:noNamespaceSchemaLocation='gen .xsd'> <Contact... (3 Replies)
Discussion started by: karumudi7
3 Replies

9. Shell Programming and Scripting

[ask]xml to flat file

dear all, i need your advice, i have xml file like this input.xml <?xml version="1.0" encoding="UTF-8"?> <session xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> <capture> <atribut name="tmp_Filename" value="INTest.rbs"/> <atribut name="size_Filename" value="INTest.rbs"/>... (2 Replies)
Discussion started by: zvtral
2 Replies

10. Shell Programming and Scripting

XML Parsing having optional tags into flat file

In xml file i have following data where some tags like<ChrgBr> may not be present in every next file. So i want these values to be stored in some variable like var1="405360,00" , var2="DEBT" and so on ,but if <ChrgBr> tag has no value or is absent var2 should have space like var2=" " so that i... (1 Reply)
Discussion started by: sandipgawale
1 Replies
SQL::Translator::Producer::XML::SQLFairy(3pm)		User Contributed Perl Documentation	     SQL::Translator::Producer::XML::SQLFairy(3pm)

NAME
SQL::Translator::Producer::XML::SQLFairy - SQLFairy's default XML format SYNOPSIS
use SQL::Translator; my $t = SQL::Translator->new( from => 'MySQL', to => 'XML-SQLFairy', filename => 'schema.sql', show_warnings => 1, ); print $t->translate; DESCRIPTION
Creates XML output of a schema, in the flavor of XML used natively by the SQLFairy project (SQL::Translator). This format is detailed here. The XML lives in the "http://sqlfairy.sourceforge.net/sqlfairy.xml" namespace. With a root element of <schema>. Objects in the schema are mapped to tags of the same name as the objects class (all lowercase). The attributes of the objects (e.g. $field->name) are mapped to attributes of the tag, except for sql, comments and action, which get mapped to child data elements. List valued attributes (such as the list of fields in an index) get mapped to comma separated lists of values in the attribute. Child objects, such as a tables fields, get mapped to child tags wrapped in a set of container tags using the plural of their contained classes name. An objects' extra attribute (a hash of arbitrary data) is mapped to a tag called extra, with the hash of data as attributes, sorted into alphabetical order. e.g. <schema name="" database="" xmlns="http://sqlfairy.sourceforge.net/sqlfairy.xml"> <tables> <table name="Story" order="1"> <fields> <field name="id" data_type="BIGINT" size="20" is_nullable="0" is_auto_increment="1" is_primary_key="1" is_foreign_key="0" order="3"> <extra ZEROFILL="1" /> <comments></comments> </field> <field name="created" data_type="datetime" size="0" is_nullable="1" is_auto_increment="0" is_primary_key="0" is_foreign_key="0" order="1"> <extra /> <comments></comments> </field> ... </fields> <indices> <index name="foobar" type="NORMAL" fields="foo,bar" options="" /> </indices> </table> </tables> <views> <view name="email_list" fields="email" order="1"> <sql>SELECT email FROM Basic WHERE email IS NOT NULL</sql> </view> </views> </schema> To see a complete example of the XML translate one of your schema :) $ sqlt -f MySQL -t XML-SQLFairy schema.sql ARGS
add_prefix Set to true to use the default namespace prefix of 'sqlf', instead of using the default namespace for "http://sqlfairy.sourceforge.net/sqlfairy.xml namespace" e.g. <!-- add_prefix=0 --> <field name="foo" /> <!-- add_prefix=1 --> <sqlf:field name="foo" /> prefix Set to the namespace prefix you want to use for the "http://sqlfairy.sourceforge.net/sqlfairy.xml namespace" e.g. <!-- prefix='foo' --> <foo:field name="foo" /> newlines If true (the default) inserts newlines around the XML, otherwise the schema is written on one line. indent When using newlines the number of whitespace characters to use as the indent. Default is 2, set to 0 to turn off indenting. LEGACY FORMAT
The previous version of the SQLFairy XML allowed the attributes of the the schema objects to be written as either xml attributes or as data elements, in any combination. The old producer could produce attribute only or data element only versions. While this allowed for lots of flexibility in writing the XML the result is a great many possible XML formats, not so good for DTD writing, XPathing etc! So we have moved to a fixed version described above. This version of the producer will now only produce the new style XML. To convert your old format files simply pass them through the translator :) $ sqlt -f XML-SQLFairy -t XML-SQLFairy schema-old.xml > schema-new.xml AUTHORS
Ken Youens-Clark <kclark@cpan.org>, Darren Chamberlain <darren@cpan.org>, Mark Addison <mark.addison@itn.co.uk>. SEE ALSO
perl(1), SQL::Translator, SQL::Translator::Parser::XML::SQLFairy, SQL::Translator::Schema, XML::Writer. perl v5.14.2 2012-01-18 SQL::Translator::Producer::XML::SQLFairy(3pm)
All times are GMT -4. The time now is 05:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy