PDA

View Full Version : Get line number or file pointer from GetLine(), or get specific line number



nnjcsc
11-13-2012, 04:51 PM
Can GetLine() or other functions read a specific line from a text file?

I'm using FileGrep which returns a line number and string. After I've found a line, I want to get the prior line, use the current line, and get the next 3 lines to write to a log file.

Is there a way to use the line number from FileGrep to get lines like this:

nvLineNumber -1
nvLineNumber
nvLineNumber +1
nvLineNumber +2
nvLineNumber +3

SpecialGetLineFunction ( filename, nvFilehandle, nvLineNumber, svReturnString)