473,387 Members | 1,423 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Converting .txt to xml format

I am a student and I have to make a java program that converts a .txt
file to xml format. Has anyone previous experience at that problem?
What methods are appropriate? Is there anywhere free code? Any ideas?
I want my program to convert simple .txt files to well-formed (or not,
if it is very difficult), not something very special. I am a novice in
Java (as student), so try to explain every answer! Thanks a lot!
Jul 17 '05 #1
5 11851
Have a look at this ebook:

http://www.cafeconleche.org/books/xmljava/

I think it will have everything you need to accomplish your goals.

"ptoum" <pt*******@mail.gr> wrote in message
news:26*************************@posting.google.co m...
I am a student and I have to make a java program that converts a .txt
file to xml format. Has anyone previous experience at that problem?
What methods are appropriate? Is there anywhere free code? Any ideas?
I want my program to convert simple .txt files to well-formed (or not,
if it is very difficult), not something very special. I am a novice in
Java (as student), so try to explain every answer! Thanks a lot!


Jul 17 '05 #2
"Patrick Thrapp" <co*******@garbage.dump> wrote in message news:<hg***************@nwrddc01.gnilink.net>...
Have a look at this ebook:

http://www.cafeconleche.org/books/xmljava/

I think it will have everything you need to accomplish your goals.


Thanks a lot! I had found a chapter of this book before I wrote the
message, but I thought, it was useless. I think I have to
reconsider...
Jul 17 '05 #3
Post a clip of the text file ...

pt*******@mail.gr (ptoum) wrote in message news:<26*************************@posting.google.c om>...
I am a student and I have to make a java program that converts a .txt
file to xml format. Has anyone previous experience at that problem?
What methods are appropriate? Is there anywhere free code? Any ideas?
I want my program to convert simple .txt files to well-formed (or not,
if it is very difficult), not something very special. I am a novice in
Java (as student), so try to explain every answer! Thanks a lot!

Jul 17 '05 #4
gi*******************@yahoo.com (GIMME) wrote in message news:<3f**************************@posting.google. com>...
Post a clip of the text file ...


I don't refer to a particular .txt file. I want a program that would
convert every simple .txt file to xml.
Jul 17 '05 #5
Well, it really depends on what the .txt file contains. Is it just
text, or is it supposed to have some structure?

If it's just text, with no particular structure, then I guess you could
"convert" it to xml by slapping start and end tags at the beginning and
end of the file respectively, and then escape all the characters in the
file that have special meaning in xml (for example '>' --> '&gt;').
Without more information on the contents of the file, this is about all
you can do.

If the files are in a particular form, you could parse it and creating a
meaningful xml file.

Hope this helps.

--Nathan Davis

ptoum wrote:
I am a student and I have to make a java program that converts a .txt
file to xml format. Has anyone previous experience at that problem?
What methods are appropriate? Is there anywhere free code? Any ideas?
I want my program to convert simple .txt files to well-formed (or not,
if it is very difficult), not something very special. I am a novice in
Java (as student), so try to explain every answer! Thanks a lot!


Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jonny Au | last post by:
Hi everyone, I have a problem about email message format converting. I want to write a program in VB.NET to convert the EML format email message to MSG format, does anyone knows how to do it?...
4
by: (Pete Cresswell) | last post by:
I've got everything in 2000 format right now, but it's now clear that all of the clients will be running 2003. Is there any advantage in converting? -- PeteCresswell
8
by: iyuen | last post by:
I'm having problems with converting a byte array to an image object~ My byte array is an picture in VB6 StdPicture format. I've used propertybag to convert the picture into base64Array format in...
1
by: Jonny Au | last post by:
Hi everyone, I have a problem about email message format converting. I want to write a program in VB.NET to convert the EML format email message to MSG format, does anyone knows how to do it?...
3
by: Sharon | last post by:
I have a buffer of byte that contains a raw data of a 1 byte-per-pixel image data. I need to convert this buffer to a Bitmap of Format32bppArgb and to a Bitmap of Format24bppRgb. Can anybody...
2
by: savigliano | last post by:
hello, i am doing a date comparation and i have reallize that the data i have in my database (general date format) it is causing me problems, and because i donīt need the time data i would like to...
3
by: nvx | last post by:
Hi, I'm looking for a simple way to convert a Double to a String exactly the .ToString() does, except these two differences: - the number of decimals is given (rounding is applied if necessary),...
2
by: Brian Parker | last post by:
I am beginning to work with VB2005.NET and I'm getting some problems with string formatting converting an application from VB6. VB6 code:- sTradeDate = Format(pArray(4,i Record), "mmddyy") ...
3
by: Jef Driesen | last post by:
How can I convert a date string to a number (e.g. a time_t value or a tm struct)? I know about the strptime function, but then I have to know the format string. And that is a problem. I'm trying...
1
by: ganesh22 | last post by:
Hi, Iam getting the below error while my application is running on IIS. in my application iam converting a text into word format, so i added some .dll from COM for converting word format ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.