AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

first_line

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
azure



Joined: 07 Jun 2007
Posts: 694

PostPosted: Fri Apr 11, 2008 5:56 pm    Post subject: first_line Reply with quote

hello

here
http://www.autohotkey.com/docs/commands/LoopReadFile.htm
it says
last_line := A_LoopReadLine

can I do first_line, second_line, etc as well?

I need to read specific lines from a file and store them in variables

thanks
Back to top
View user's profile Send private message
tonne



Joined: 06 Jun 2006
Posts: 1651
Location: Denmark

PostPosted: Fri Apr 11, 2008 6:00 pm    Post subject: Reply with quote

FileReadLine?
_________________
RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2
Back to top
View user's profile Send private message
Tuncay



Joined: 07 Nov 2006
Posts: 1886
Location: Germany

PostPosted: Fri Apr 11, 2008 9:33 pm    Post subject: Reply with quote

User function to read lines from variables:
http://www.autohotkey.com/forum/viewtopic.php?t=26383&start=0&postdays=0&postorder=asc&highlight=readline
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Rhys



Joined: 17 Apr 2007
Posts: 761
Location: Florida

PostPosted: Fri Apr 11, 2008 11:19 pm    Post subject: Reply with quote

If parsing or reading a file line by line, you could also do...
Code:
If (A_Index = 1)
   Var1:=A_LoopField
If (A_Index = 3)
   Var3:=A_LoopField
If (A_Index = 4)
   Var4:=A_LoopField
If (A_Index = 231)
   Var231:=A_LoopField
Etc...
_________________
[Join IRC!]
Back to top
View user's profile Send private message
trik



Joined: 15 Jul 2007
Posts: 1320

PostPosted: Sat Apr 12, 2008 3:28 am    Post subject: Reply with quote

Or..

Code:
FileRead, Con, File.txt
Loop, Parse, Con, `n
{
   FileReadLine, Line, File.txt, %A_Index%
   Var%A_Index% := A_LoopField
}
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group