Jump to content

Recommended Posts

What i am trying to do is read the value of an input box and then find that value in a text file, so i can copy the text that follows the space after the beginning of that line. Each entry in the text file starts with a 4 digit number followed by a space and then the rest of the text i am looking to copy. So basically someone would enter a value in the input box and then hit a button that would find the appropriate text and copy whatever info if after the space. Any help would be greatly appreciated. Thank you very much.

Link to post
Share on other sites

If each entry is on a separate line, the basic way would be to...

Open the file ( FileOpen() )

Iterate through the lines of the file ( FileReadLine() )

Check The first 4 chars of each line ( StringLeft() )

Return the rest of the line if found ( StringTrimLeft() )

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to post
Share on other sites

Unfortunately I'm at college at the moment so I can't really help you with the code right now however In the help file I would suggest starting by reading up on fileopen, filereadline, stringinstr and while loops.

Edit: Beat Me To It Woops (Didn't think about stringtrim silly me) :D

Edited by Venix
Link to post
Share on other sites

Thank you both for the prompt response. I ll work on writing some code and posting it. So far i was using StringMid and I was able to open a file for reading and trim the first 6 characters i needed to eliminate and then copy the other 45 to the clipboard with Clipput. I am not sure though how i would go about matching it and then telling it that that's the line i want it to work with. Thanks again.

Link to post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...