save file to database

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: May 2007
Posts: 11
Reputation: katerinaaa is an unknown quantity at this point 
Solved Threads: 0
katerinaaa katerinaaa is offline Offline
Newbie Poster

save file to database

 
0
  #1
Aug 13th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 353
Reputation: aniseed is an unknown quantity at this point 
Solved Threads: 6
aniseed's Avatar
aniseed aniseed is offline Offline
Posting Whiz

Re: save file to database

 
0
  #2
Aug 13th, 2007
Originally Posted by katerinaaa View Post
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).
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 11
Reputation: katerinaaa is an unknown quantity at this point 
Solved Threads: 0
katerinaaa katerinaaa is offline Offline
Newbie Poster

Re: save file to database

 
0
  #3
Aug 14th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 11
Reputation: katerinaaa is an unknown quantity at this point 
Solved Threads: 0
katerinaaa katerinaaa is offline Offline
Newbie Poster

Re: save file to database

 
0
  #4
Aug 14th, 2007
Originally Posted by katerinaaa View Post
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC