• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Replacing a perticular text in property file keeping other content intact

 
Ramakanta Sahoo
Ranch Hand
Posts: 256
Fedora Firefox Browser Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I am having little problem in writing back to a property and log file.
What I am doing is i am searching a string in a logfile and counting the occurances of the string in the file and writing the matched strings into a file which i use to mail if the occurences increase in the logfile.
If the new count of search string will be same as old count then no mail will be sent. For that I am facing a problem in writing back the new occurance count to the property file .
Plus one more problem is in creating the logfile i want the logfile to be newly created/replaced but the matched string should get appended back to back to the new file.
How do i do it. please help
Below is my sample code

 
Campbell Ritchie
Sheriff
Pie
Posts: 49367
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Too difficult a question for beginners'. Moving.
 
Ramakanta Sahoo
Ranch Hand
Posts: 256
Fedora Firefox Browser Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok Thanks Campbell,

I am done with the log file creation problem.
but the writing the new matched strings count back to the property file as "TCount" is still not done.
Can i edit it or i have to erite the total properties file once again. please help.

My properties file:



I want to change the TCount to the new number of matched string so that next time my program runs it will not report the same error if the TCount will be same as NewCount.
If newcount will be greater then it will send the mail and change the TCount old value to the newcount value.

I am done with all other coding but not able to write the newcount value to TCount value keeping other parameters intact.

Help Please How do i achieve this.???
 
Ramakanta Sahoo
Ranch Hand
Posts: 256
Fedora Firefox Browser Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please help???

Any Any Updates Ranchers??

Still waiting.
please help
 
Ramakanta Sahoo
Ranch Hand
Posts: 256
Fedora Firefox Browser Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Finally I changed the route I was going
instead of updating inputs.properties i created a new property file with only TCount value and my program is now updating the file each time it runs.

Used mail.jar and activation.jar to send mails.



Regards,
Ricky
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic