Jump to content

[Suggestion Needed] Read Text File


ZahidAli
 Share

Recommended Posts

Hello,

I just started using Auto It Scripting Language i am slowly learning things how i can make my daily routine task on auto pilot as much as possible.

I am having issue to make script for my requirement right now. I want script to read my text file (Line by Line) and store it in a variable and and when i want it Type/Sent that text to textbox in website. I want to use HotKey to trigger that function. Lets say i want to enter data on Text Box from the File which have 10 Lines but i want all to be written in text box 1 by 1 when i press my desired hotkey it read the line and enter that text to textbox and pause/stop it self and when i again press my HotKey it start with second line and enter that text into textbox and so on until all line in text file complete. 

Link to comment
Share on other sites

  • Moderators

@ZahidAli welcome to the forum. Please look at FileRead and FileReadyToArray in the help file. As always, there are multiple ways to skin the proverbial cat, but with either of those you can read an text file into a variable, and then use it as needed later in your script.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

21 minutes ago, JLogan3o13 said:

@ZahidAli welcome to the forum. Please look at FileRead and FileReadyToArray in the help file. As always, there are multiple ways to skin the proverbial cat, but with either of those you can read an text file into a variable, and then use it as needed later in your script.

Just Simple Test with my Current Little Knowledge

HotKeySet("{F1}", "uName")

Global $file = "names.txt"
FileOpen($file, 0)

Func uName()

For $s = 1 to _FileCountLines($file)
    $line = FileReadLine($file, $s)
     msgbox(0,'','the line ' & $s & ' is ' & $line)
Next

EndFunc

Now i want is to Show each line one by one in MsgBox whenever press F1. I mean if it show Line 1 and next time i press F1 it should show Line 2 and so on

Link to comment
Share on other sites

  • Jos locked this topic
  • Moderators

Agreed. @ZahidAli you made it clear in the other thread that you are fully aware what you are doing violates Google TOS. Be aware you have called into question any future posts by doing so.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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