Hi,
I want to save a .txt file into database using java language, how can it is possible ?

The .txt file has one word per line and I would like when the program find a string like "<P>" to continue until line with "</P>". If it is found to increase a counter .

Any ideas?

Thank you

Re: save file to database 80 80

Hi,
I want to save a .txt file into database using java language, how can it is possible ?

You can save it as a String (VARCHAR) or CLOB. That depends on what you want to store.

The .txt file has one word per line and I would like when the program find a string like "<P>" to continue until line with "</P>". If it is found to increase a counter .

That's got nothing to do with saving the data or the file. You could make use of a HTML parser or a regex (if there is an obvious pattern to it).

Re: save file to database 80 80

Actually I want to make some searches and for this reason and because of file length I think that is better to save text into database.

Searches like find the 10th, 100th word of text.
Which word appears more times...
Which two words appears more times in text . ..
etc

But I don't know how could it be better...

Do you think that I have to save the text like string?
Are there any sites for this or a little more help.

Thanking you in advance

Re: save file to database 80 80

Actually I want to make some searches and for this reason and because of file length I think that is better to save text into database.

Searches like find the 10th, 100th word of text.
Which word appears more times...
Which two words appears more times in text . ..
etc

But I don't know how could it be better...

Do you think that I have to save the text like string?
Are there any sites for this or a little more help.

Thanking you in advance

I think it's better to save every paragraph as a different insert in a table.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.