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

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



Joined: 07 Jun 2007
Posts: 297

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: 1259
Location: Denmark

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

FileReadLine?
_________________
there's a dog barking close within the range of my ear
sounds like he wants to escape the chain
he would probably bite me to death if he could
but the chain lets me spit in his face

- Kashmir
Back to top
View user's profile Send private message
Tuncay



Joined: 07 Nov 2006
Posts: 383
Location: Berlin

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
Rhys



Joined: 17 Apr 2007
Posts: 736
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!]

http://www.codeforcure.org/
Back to top
View user's profile Send private message
Trikster



Joined: 15 Jul 2007
Posts: 1224
Location: Enterprise, Alabama

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:   
Post new topic   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