Jump to content

Recommended Posts

Posted

Hi

I want to read the second line from a txt file and then to use it in a script.

Please help

At last i can repay some debt by answering a question instead of asking! And i won't get sarky and say RTFM!

FileReadLine ( filehandle or "filename" [, line] ) is the function you need.

William

Posted

Hi

I want to read the second line from a txt file and then to use it in a script.

Please help

Or like in this example:

#Include <File.au3>
$PATH = FileOpenDialog("SELECT",@ScriptDir,"All (*.*)",1)
Dim $LINE
_FileReadToArray($PATH,$LINE)
If IsArray($LINE) And $LINE[0] >= 2 Then MsgBox(0,"LINE 2",$LINE[2])
  • 1 month later...
Posted

How do I read the second to last line of a file with an unknown number of lines?

FileReadLine will read the last line with a line number = -1 but I can't figure out how to read the line previous to that.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...