In this section, we have developed an application to
create xml file from flat file and data insert into database in Java.
Two files are used "FlatFileXml.java"
and "flatfile.txt" in
the code given below.
Flat file: A flat file is a
simple plain text file. It consists of one record per line.
The fields can be separated by delimiters, e.g. commas,
or have a fixed length. It
is a static document, spreadsheet, or textual record that typically contains data that is not structurally related.
Brief description of the flow of application :
1). Create a flat file "flatfile.txt".
2). Create a file "FlatFileXml.java" used to create an XML and data insert into the database.
Step:1 Create a "flatfile" table in Database .
| create table `flatfile` ( `id` int , `title` varchar (250), `url` varchar (250) ) |
Step:2 Create a "FlatFileXml.java"
import java.io.*;
|
Step:3 Create a flat file "flatfile.txt".
Java - http://www.roseindia.net
|
Output:

After run Successfully Create an XML file "flatfile.xml"
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Create XML file from flat file and data insert into database View All Comments
Post your Comment