What do you mean? What is ".log"? is that a language? a file format? Why can't you read it like any other file in java?
Never ascribe to malice that which can be adequately explained by stupidity.
Mazer Lao Tzu
Ranch Hand
Joined: Jan 20, 2010
Posts: 35
posted
0
".log" is simply a common file extension indicating that a particular file serves as a log for a particular application. Most likely these files are written in ASCII, but the format in which they represent data is entirely dependent on the application that wrote the file.
What application wrote the file?
-- Mazer
motress zlting
Ranch Hand
Joined: Jan 10, 2010
Posts: 55
posted
0
fred rosenberger wrote:What do you mean? What is ".log"? is that a language? a file format? Why can't you read it like any other file in java?
It is a text file with the extension .log which contains data inside.
Where can i find the coding to read the data in .log file and display it ?
W. Joe Smith
Ranch Hand
Joined: Feb 10, 2009
Posts: 710
posted
0
If it is just a plain text file with a .log extension, you should just be able to use the same code that you would use to read a regular .txt file.
SCJA
When I die, I want people to look at me and say "Yeah, he might have been crazy, but that was one zarkin frood that knew where his towel was."
motress zlting
Ranch Hand
Joined: Jan 10, 2010
Posts: 55
posted
0
Mazer Lao Tzu wrote:".log" is simply a common file extension indicating that a particular file serves as a log for a particular application. Most likely these files are written in ASCII, but the format in which they represent data is entirely dependent on the application that wrote the file.
What application wrote the file?
Accuatly the log file is created using placelab (an open source to detect wireless signal). Its detect all wireless ap signal strength in a particular area and save it in log file.
The above is part of the log file data which contain the type of wireless ap, time detected, Id, name of wireless ap, signal strength and so on.
But i just want to read the signal strength, count the signal average and display it.
Can you write a java program to open and read any file? There is nothing special about it being a '.log' file.
[edit]
So now we're getting what you really want. You still need to be able to do the above. I'd suggest you write a program that reads each line and prints it out first. Once you have that, you can start looking at parsing the data. The best way to do this is by writing a little piece at a time.
motress zlting
Ranch Hand
Joined: Jan 10, 2010
Posts: 55
posted
0
fred rosenberger wrote:Can you write a java program to open and read any file? There is nothing special about it being a '.log' file.
[edit]
So now we're getting what you really want. You still need to be able to do the above. I'd suggest you write a program that reads each line and prints it out first. Once you have that, you can start looking at parsing the data. The best way to do this is by writing a little piece at a time.
Now i can read the file and display it. Thank to all.
But the problem i faced now is how am i gonna just read the signal strength RSSI ? I don wan to display other info, just want to display the signal strength.
Ehm, that's not necessarily 2 characters. It may also be 3, like -90.
You do have a point however. Using indexOf you can first find where RSSI= starts, and advance to the end of that. Next find the next |, and take the substring in between.
since all the examples had the '-', it didn't matter. but that is a good point. Could you have 3-digit or 1-digit values? or 4-digit?
the larger point is there is more than one way to do it.
motress zlting
Ranch Hand
Joined: Jan 10, 2010
Posts: 55
posted
0
fred rosenberger wrote:since all the examples had the '-', it didn't matter. but that is a good point. Could you have 3-digit or 1-digit values? or 4-digit?
the larger point is there is more than one way to do it.
largest is 3 digit such as -90 .
motress zlting
Ranch Hand
Joined: Jan 10, 2010
Posts: 55
posted
0
Rob Prime wrote:Ehm, that's not necessarily 2 characters. It may also be 3, like -90.
You do have a point however. Using indexOf you can first find where RSSI= starts, and advance to the end of that. Next find the next |, and take the substring in between.
But the indexOf() is just use to show the location of the character and printout the location number.
How can i make it to take the -90 and print it out ?
motress zlting wrote:
But the indexOf() is just use to show the location of the character and printout the location number.
How can i make it to take the -90 and print it out ?
As mentioned on your other (somewhat duplicate) topic...
The best way to figure out how to code it is to write out how you would do it by hand.
Say you were going to hand a piece of paper to someone with this data on it. They don't know what ANY of this stuff means, what's relevant and what's not.
How would you tell them to find the specific piece of data you want from each line?