Jump to content

Fileread Problem


Recommended Posts

hoi,hoi all,

i having trouble with a script i was to read 4 field from a file and take though values and write them to another spot the problem is there are lines of junk in between that i need to ignore and in some cases i only want to use one work noth the whole line is there anything i can can do to do this if you can please help

thank you

Frankie PAul

ƒrankie Paul
Link to comment
Share on other sites

hoi,hoi all,

i having trouble with a script i was to read 4 field from a file and take though values and write them to another spot the problem is there are lines of junk in between that i need to ignore and in some cases i only want to use one work noth the whole line is there anything i can can do to do this if you can please help

thank you

Frankie PAul

that is called parsing, just so you know, and it can be done very easily with the string manipulation functions in AutoIT. in the help file, go to the index tab, and just type string. you'll see alot of string functions to use parsing your data. also, because some level of parsing is needed in almost any I/O operations for data that is beyond the scripts control, you can find alot of examples of string manipulation and parsing in posts on this forum.

Link to comment
Share on other sites

  • Developers

something like this ?

; Read in lines of text until the EOF is reached
While 1
    $line = FileReadLine($file)
    If @error = -1 Then ExitLoop

    Select
        Case StringLeft($line, 2) = "//"
        ;
        Case StringLeft($line, 4) = "Id = "
        ;
    EndSelect
WEnd

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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...