Sign in to follow this  
Followers 0
boltc

search in a file

6 posts in this topic

i want to let my program do this:

reads a file, and then search for a word.. is that possible?

sorry for my very bad english

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

one way to do that would be (in pseudo-code):

Open the file

Start a Loop
   If you have gotten to the end of the file then exit your loop

   Read a line from the file
   Search that line for the word you are looking for
       If you find it then do whatever it is that you want to do

Loop back to the start

Close your file

Look in the help file for words like:

FileOpen()

FileReadLine()

StringInStr()

FileClose()

Edited by SpookMeister

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Share this post


Link to post
Share on other sites

the next problem is the following:

i want to read a *.dat file..

but when the program reads a line like:

PluginDisableÞÊÞMs Yep, I'm here. - provided by Wake

then it only reads this:

PluginDisableÞÊÞMs

it stops when the comes...

so the program still not find what i want...

how can i fix this?

Share this post


Link to post
Share on other sites

um... did you write the .dat file?


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

no:(

Share this post


Link to post
Share on other sites

Latest "beta" version supports binarystring data.

Lar.

yea it works.. thank you!

Share this post


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
Sign in to follow this  
Followers 0