This is appropriate for relatively small files; it might be slow if the text file can grow very large. For this reason, I had suggested LLFF. However, reading the entire file and writing it back is easier, and it can be appropriate, depending on the expected file size.
>>I want to read the text file contents from bottom to top line by line and simultaneously delete the line from bottom top line by line.
>
>Ravi,
>
>Assume lines are sepatared by CRLF, or only by CR or LF.
>
>
>lcOldText = FileToStr('filename')
>lnCR = RAT(CHR(13),lcFileText)
>lnLF = RAT(CHR(10),lcFileText)
>IF lnLF - lnCR = 1
> * There is a CRLF or only a LF in position 1
> lcLastLine = SUBSTR(lcOldText,lnLF+1)
> lcNewText = LEFT(lcOldText,lnCR-1)
>ELSE
> * Lines are separated by a lone CR or LF
> lcLastLine = SUBSTR(lcOldText,MAX(lnCR,lnLF)+1)
> lcNewText = LEFT(lcOldText,MAX(lnCR,lnLF)-1))
>ENDIF
>StrToFile(lcNewText,'filename')
>
>
>Alex
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)