Jump to content

Open File


Recommended Posts

Hi

Sorry to ask what seems like a real dumb question but how the heck do i open a specific file

i have looked on the web and the forums and all i have seen is $file = FileOpen("test.txt", 10)

How do you nominate what drive or folder you intend to lookin

Sorry again for the dumb question, maybe i cannot see for looking

Grant

Link to comment
Share on other sites

Many thanks for the response

Im not sure what im doing wrong but but im still unable to open the file

i get no errors so i am presuming it opens ok, do i need to add something to show the file

Im completely new to all of this so please excuse my dumb questions

Thanks in advance :unsure:

Link to comment
Share on other sites

at the moment im just playing around trying to learn Autoit and this was the first step as the application i want to eventually build will need this feature

Im used to using automated software without the coding so the steps are completely different

I am trying to build a project where emails are downloaded and then parsed and the data placed into excel and control boxes in the GUI

I have done this prior with automated software very easy but you can use this software with a Gui, hence the need to do this through AutoIt

How long does it take on average to learn this ?

also can you advise of how i incorporate a GUI i have designed with Design studi with AutoIt

Thanks again

Link to comment
Share on other sites

Hi Gmccormack,

try this:

$filehandle = FileOpen("C:\Path\To\file\File.txt")

While 1
    $line = FileReadLine($filehandle)
    If @error = -1 Then ExitLoop
    MsgBox(0, "Line read:", $line)
Wend

This was taken almost completely from the helpfile, which actually is a good place to start. :unsure:

Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]
Link to comment
Share on other sites

HI Hannes

I did look honest :unsure::>

there is that much there its a job to view it all

Ok i tried what you said and even though i get no error it still wont work

This the code with my file path

$filehandle = FileOpen("C:\Libraries\Documents\Test.txt")

While 1

$line = FileReadLine($filehandle)

If @error = -1 Then ExitLoop

MsgBox(0, "Line read:", $line)

Wend

What am i doing wrong

Link to comment
Share on other sites

How long does it take on average to learn this ?

It depends. The learning curve with AutoIt is quite steep and you can achieve a lot of things very quickly. I don't think anyone can tell you how long it takes for you to learn it - unless he has worked with you for a while. My trainees usually take 3-4 weeks until they can code some simple applications. Some are faster some "not that fast" and some will never learn. :>

also can you advise of how i incorporate a GUI i have designed with Design studi with AutoIt

You can use KodaForm editor (that comes along with Scite4AutoIT) to build GUIs, but from my point of view this belongs to the more complex things to do with AutoIT. Take your time and start slow. Read the manual. Search the forum. :unsure:

Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]
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...