This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes How to append data to the Logfile with out duplicate values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "How to append data to the Logfile with out duplicate values" Watch "How to append data to the Logfile with out duplicate values" New topic
Author

How to append data to the Logfile with out duplicate values

mohan reddy
Greenhorn

Joined: May 14, 2001
Posts: 1
HI,
Basically i need to appand data to the logfile.If there is Duplicate data it should not tbe appended..
Here is the piece of code that i have written to append... Any one could help me how to restrict the Duplicate values not to append to the LogFile..
FileWriter frw = null;
File logFile = new File (logPath);
if(logFile.exists() == true)
{
try{
frw = new FileWriter(logPath, true);
}catch(IOException e){
System.out.println("LogPath :Failed -"
+ e);
}
}
else
{
try{
frw = new FileWriter(logFile);
}catch(IOException e){
System.out.println("LogPath :Failed -" +
e);
}
}
thanks for you'r Help..
Mohan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to append data to the Logfile with out duplicate values
 
Similar Threads
Wait and Notify
Writing a Char Array to a tab delimited file
Replacing a perticular text in property file keeping other content intact
unble to write the data into file
move file A to file B