Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# read last 10 lines of file

var nrOfPagesToRead = 10;
var lastLines = File.ReadLines(filePath).TakeLast(nrOfPagesToRead);
// careful because ReadLines(path) reads all the file in memory.
// Do not use this for large files.
 
PREVIOUS NEXT
Tagged: #read #lines #file
ADD COMMENT
Topic
Name
5+5 =