[Gambas-user] Is it possible to read (and write) specific parts of a text file?

LinuxSeeker linuxseeker at ...626...
Tue Aug 15 18:02:02 CEST 2006


I want to use a single configuration file (plain text) for my application.
The format of the configuration file will be like:

----------------------------------
#Program configuration
[information]
name: appname
[data]
enabled_textbox_number: 5
textbox1_text: content1
textbox2_text: content2
textbox3_text: content3
textbox4_text: content4
textbox5_text: content5
textbox6_text: NONE
textbox7_text: NONE
checkbox1_checked: NO
[comments]
TextArea1_text: blah blah blah
------------------------------------

So I must be able to read after the ":" in each line. The form1 text for
example must be the content after the "name:" (appname), the text of a
combobox (which contains the numbers from 1 to 10) must be the part after
the "enabled_textbox_number:" (5), the text of TextArea1 must be the one
after "TextArea1_text:" (blah blah blah) etc. The lines starting with # and
the text between square brackets is like comments and should not be used.

Any suggestions? I have very limited experience when it comes to working
with files, so even the simplest suggestions are welcome.
Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20060815/4592c93f/attachment.html>


More information about the User mailing list