Log Reader(Last N rows); - General Discussion - Netduino Forums
   
Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Log Reader(Last N rows);

log reader.

  • Please log in to reply
No replies to this topic

#1 Giuliano

Giuliano

    Advanced Member

  • Members
  • PipPipPip
  • 361 posts
  • LocationSimi Valley, CA

Posted 03 April 2013 - 05:14 AM

Good day everyone,

 

I've created a method to read a log file from the Netduino SD card. The good thing about the approach I took is that it works really fast and the reason behind that is that it goes from the end of the file and then starts looking for a delimiter, in this case the carriage return and new line bytes (1310 or rn in English) and then once it reaches the number of carriage returns + new line breaks (# of rows) you wish to retrieve from the log, it then starts reading forward using the traditional ReadLine() method up to the end of the file.

 

I've tried this code in my N+2 for a while and it is working fine so far.

 

Attached is the demo project of it.

 

Sorry in advance for not putting any comments in the code. If you have any questions, comments or suggestions, please do not hesitate to drop a line here or PM me.

 

Enjoy!

Attached Files






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.