".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 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.
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.
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.
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?
Post by:autobot
God is a comedian playing for an audience that is afraid to laugh - Voltair. tiny ad:
a bit of art, as a gift, that will fit in a stocking