aspose file tools*
The moose likes JDBC and the fly likes How to convert dictionary words from .txt file to database? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to convert dictionary words from .txt file to database?" Watch "How to convert dictionary words from .txt file to database?" New topic
Author

How to convert dictionary words from .txt file to database?

Ivan Bisevac
Ranch Hand

Joined: Jan 04, 2010
Posts: 48

I am learning Java and i know basic java and oo technologies and learned how to make windows. Also i know to work with databases and servlets. I graduated for bachelor on databases.
Now i would like to make english-serbian dictionary in java.
I have words in .doc file but i copied these words from .doc to .txt. How i have doubt is possible to convert from .doc or .txt file to database. Is it big job? I have expirience in programming but not in data conversion..

Here is part of .txt file:



First is a Serbian word following English translations. Problem may be english translations which are not in same row. For example:

Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Parsing a text file and populating a database table with its data is easy enough (you can often do this with a database's own loading tool). Your issue is defining where a single definition ends. You may be able to find a common pattern for the start of a definition and use that to delimit stuff; you will have to make the call if this is possible based on the data you have.

You can access the file using the java.io package. Any clever parsing is best achieved with classes in the java.util.regex package.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ivan Bisevac
Ranch Hand

Joined: Jan 04, 2010
Posts: 48

Thanks a lot, i will try and post here what i did.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to convert dictionary words from .txt file to database?