Results 201 to 220 of 395
Thread: [SOLVED] Read From LOGFILE
- 05-29-2008, 03:49 AM #201
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 05-29-2008, 06:04 AM #202
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
- 05-29-2008, 06:30 AM #203
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Yes pal, it's working perfectly for me.
- 05-29-2008, 06:43 AM #204
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
Sir i run your code.what's your out put sir.If you are click again and again on Record button then what you are gating.are you gating only one time out put or many time same out put.
See what i am geting
1) Click on record button then i am geting 192.168.6.1 and 192.168.6.2
2) Click on record button then i am geting 192.168.6.1 and 192.168.6.2
3)Click on record button then i am geting 192.168.6.1 and 192.168.6.2
These are showing like this
192.168.6.2
192.168.6.1
192.168.6.2
192.168.6.1
192.168.6.2
192.168.6.1
And I want to show
1) Click on record button then i am geting 192.168.6.1 and 192.168.6.2
2) Click on record button then i am geting 192.168.6.1 and 192.168.6.2
3)Click on record button then i am geting 192.168.6.1 and 192.168.6.2
And showing like this
192.168.6.2
192.168.6.1
this is my problem
- 05-29-2008, 06:53 AM #205
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
You asking same thing again and again pal.
Yesterday I ask to add a line text.setText(""); Did you do it.
Send the public boolean action (Event evt, Object arg) method of the LogFileDlg.java class.
- 05-29-2008, 07:00 AM #206
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
- 05-29-2008, 07:06 AM #207
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
Sorry sir...
Sir may i count how many time a single Ip open.
i mean is 192.168.6.1 has open 10site it means my log file have redord of 10time of 192.168.6.1. ANd some other ip 192.168.6.2 has open 20site.All redords is record in my log file.
Now can i count how many time open a single Ip (192.168.6.1).
- 05-29-2008, 07:29 AM #208
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
What happen sir?
- 05-29-2008, 07:52 AM #209
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
Sir are you angry with me..
- 05-29-2008, 08:55 AM #210
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Maintain a counter in each search before add to the array list.
Best place is the LogRecords class.
- 05-29-2008, 09:14 AM #211
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
- 05-29-2008, 09:23 AM #212
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
All the time try to do in separately.
I give a hint. When you found an entry(doesn't matter a duplicate or not) add all of them in another array list. Try to count there each duplicates.
- 05-29-2008, 09:28 AM #213
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
Sir can you give me code..
- 05-29-2008, 10:10 AM #214
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
Hello Sir...
- 05-29-2008, 10:22 AM #215
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Why don't you try it. Google may have the solution. I've show the way to move. I'll try it later, not now.
- 05-29-2008, 11:04 AM #216
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
ok sir i am waiting for your ans.Next day i will ask to you..
- 05-29-2008, 02:15 PM #217
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
Ok Sir i am fiend Example of this.When i impliment then i am geting error.So here i post the example plz impliment it
Plz help meJava Code:import java.io.*; public class OccurancesInArray{ public static void main(String[] args) throws IOException{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); System.out.print("How many elements you want to enter in the array: "); int num=0; try{ num = Integer.parseInt(in.readLine()); } catch(NumberFormatException ne){ System.out.println(ne.getMessage() + " is not a number!"); System.exit(0); } String[] elements = new String[num]; int a; int k; for(int i = 0; i < num; i++){ elements[i] = in.readLine(); } for(int i = 0; i < elements.length; i++){ a = 0; k = 1; for(int j = 0; j < elements.length; j++){ if(j >= i){ if(elements[i].equals(elements[j]) && j != i){ k++; } } else if(elements[i].equals(elements[j])){ a = 1; } } if(a != 1){ System.out.println("Occurance of \'" + elements[i] + "\' : " + k); } } } }
- 05-29-2008, 02:25 PM #218
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Oh, why did you use such a long way to do it. Actual situation is far more beyond than this. You just want to read a file to do all those things, that is what you have work on right now.
Think on that place.
- 05-29-2008, 02:48 PM #219
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
ok as you told me i have store in array. Plz give me code at last time
- 05-29-2008, 02:51 PM #220
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Not in an array... Think that. your log file doesn't contain fix number of entries. So how would you define the size of the array.
Try to do something. I never give a help like this to anyone else here in the forum. I'll give a code, not now. Try something pal. :)
Similar Threads
-
Must Read.....
By sanjeevtarar in forum Forum LobbyReplies: 10Last Post: 03-03-2010, 07:16 PM -
how to read a form with JFS
By crispy in forum JavaServer Faces (JSF)Replies: 2Last Post: 05-01-2008, 03:07 PM -
Read file
By tajinvillage in forum Threads and SynchronizationReplies: 0Last Post: 01-29-2008, 09:10 AM -
How to read the following
By rrp in forum New To JavaReplies: 0Last Post: 12-03-2007, 06:16 PM -
read txt file
By sureshsri1981 in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 08-05-2007, 03:49 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks