Jump to content

Having Trouble Writing a script


kizman
 Share

Recommended Posts

Whats the best way to make a script that reads 2 files LINE BY LINE:

One.txt

Two.txt

Replaces certain data in index.html with data from one.txt and two.txt

Then opens the html file. ( The html file contains a form that auto-submits)

And restarts over until the last line is reached. (Both files contain same amount of lines in this case 444)

If example code is provided I WILL learn from it. This is highly appreciated.

Example

READ LINE 1 ONE.TXT

READ LINE 1 TWO.TXT

OPEN INDEX.HTML

REPLACE <STUFF> WITH LINE 1 FROM ONE.TXT

REPLACE <STUFF2> WITH LINE 1 FROM TWO.TXT

OPEN INDEX.HTML

SLEEP 10 SECS

RESTART UNTIL LAST LINE IS REACHED.

Edited by kizman
Link to comment
Share on other sites

Check out the following functions in the Help file for AutoIt. They can do what you need.

FileReadLine()  ;Read in a line of text from a text file.
StringInStr()   ;Checks if a string contains a given substring.
StringReplace() ;Replaces substrings in a string.
Link to comment
Share on other sites

Check out the following functions in the Help file for AutoIt. They can do what you need.

FileReadLine() ;Read in a line of text from a text file.
StringInStr()  ;Checks if a string contains a given substring.
StringReplace();Replaces substrings in a string.
Also, the _IE* functions of the IE.au3 UDF for opening the page, entering values, and submitting the form.

@kizman: There are many examples already posted for each of these steps, and the best are in the help file with the functions you need. "If you do it all for me, I might learn something from it" is NOT the model here... :)

Start with some basic practice scripts that only perform one part, like the file reads or the _IE functions. If you get stuck, post what you've got and you'll get more help.

>_<

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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