> I have a large text file, which contains data in the form:
>
> parameter name="value" // comment about the line
>
> For example:
>
> LCD Display Modes="3" // Add the modes to allow them: 1=status 2=aids
> 4=engine/brake temps
>
> I am trying to make a GUI that will allow you to see the parameter,
default
> and currect values, comment and will allow you to change the value.
>
> I can do the GUI part with no problem, but I'm wondering how to handle
the
> file part. I just need to know what's the best way of going about it.
I.e.
> how to get all the data into my script, and how to write it back out
again.
>
> Should I read the whole file into an array, process each line into the
GUI,
> allow changes to each line, then delete the original file, and write the
> array back out to a file?
>
> I just need a principle to work with, or a pointer to where to start
> reading.
>
> Thanks.
>

Take a look at Tie::File, it will take care of the reading/writing part for
you.  Then all you need to do is write a little bit of code to parse a line
into the elements you want to display, and another little bit to reformat
them before updating the array (file).

Steve

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to