• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Replacing a perticular text in property file keeping other content intact

 
Ranch Hand
Posts: 256
Netbeans IDE Firefox Browser Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Too difficult a question for beginners'. Moving.
 
Ramakanta Sahoo
Ranch Hand
Posts: 256
Netbeans IDE Firefox Browser Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Netbeans IDE Firefox Browser Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please help???

Any Any Updates Ranchers??

Still waiting.
please help
 
Ramakanta Sahoo
Ranch Hand
Posts: 256
Netbeans IDE Firefox Browser Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic