?
Solved

How to convert Flat files to XML

Posted on 2003-11-13
4
Medium Priority
?
541 Views
Last Modified: 2012-06-21
HI,

I am in a situation to convert Flat files with XFlat schema to XML files without a converter. I need to write a one. Which language or technology would help me out to write that. Can u also suggest a good book on this.

Thanx,
0
Comment
Question by:subbiahm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 15

Accepted Solution

by:
dualsoul earned 252 total points
ID: 9745218
hm...what's this xFlat schema?
i think you can parse your flat file and generate SAXevents - so it will look like just a SAXParser parses simple xml. So you get xml on-the-fly from your text file. And then just save it.
   I think you can use any technology you like:
Java, COM the idea is very simple.
0
 
LVL 9

Assisted Solution

by:sparkplug
sparkplug earned 248 total points
ID: 9747799
Why not use XML Convert? http://www.unidex.com/overview.htm.

Alternatively, it is a relatively simple task to read a CSV file and convert to XML in any programming language (VB, Java, C++, C#). The language you use depends on your experience and the environment/platform you are working with.

An XML parser such as MSXML or Xerces would be useful for creating the XML output. If you need to read the XFlat schemas for information about the conversion you can either use a library such as http://www.cadenux.com/xflat/ or, as an XFlat schema is XML, you can read it using an XML parser and write your own code to interprete the informaton within.


>S'Plug<
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question