I use a loop of external files.Set the file to have multiple lines and only one column.
How do I use variables in an AHK loop to see how many times the loop is going through the file and what the contents of the file are for this loop line?
For example, "D:\test.txt", which has 16 lines.
In a loop where AHK reads files, how can I see the file contents of the first loop as 300002 using a variable
Thanks!
How to read the contents of each line in a file loop?
How to read the contents of each line in a file loop?
- Attachments
-
- 2022-05-26_21-39-23.png (41.95 KiB) Viewed 688 times
Re: How to read the contents of each line in a file loop?
Hallo,
try:or test with MsgBox:Outside the Loop A_LoopReadLine and A_Index no longer exist.
try:
Code: Select all
Loop, Read, D:\test.txt
las := A_LoopReadLine, ne := A_Index
Code: Select all
Loop, Read, D:\test.txt
MsgBox,% (las := A_LoopReadLine) "`n" (ne := A_Index)
Re: How to read the contents of each line in a file loop?
Thank you, what I need is how can I see the variable showing the file contents of the first loop :300002Rohwedder wrote: ↑26 May 2022, 11:35Hallo,
try:or test with MsgBox:Code: Select all
Loop, Read, D:\test.txt las := A_LoopReadLine, ne := A_Index
Outside the Loop A_LoopReadLine and A_Index no longer exist.Code: Select all
Loop, Read, D:\test.txt MsgBox,% (las := A_LoopReadLine) "`n" (ne := A_Index)
Re: How to read the contents of each line in a file loop?
With "test with MsgBox" first displayed Msgbox first line?
If it is not that, I need more information e.g. test.txt.
If it is not that, I need more information e.g. test.txt.
Re: How to read the contents of each line in a file loop?
Use this command correctly
Thanks!
- Attachments
-
- 20220527131800.png (14.53 KiB) Viewed 576 times