<div>You can create this modularly by : </div><div>1. parse the file and cut this into different chunks ( look for 'end' ) then you have two chunks for param 1 & 2  </div><div>2. once you have those chunks then process each chunk with your own processing based on your parameters ( 1 or 2 )</div>
<div>3. then based on your individual param, create a process to populate your dict </div><div>4. done </div><div><br></div><div>hint: "pydoc string"  ( I'm assuming that you already know about regex, if not then use this : "pydoc re"  ) </div>
<div>BTW: I've used this methods to parse  cisco/contivity configs </div><div><br></div>HTH <br><br><div class="gmail_quote">On Fri, May 29, 2009 at 9:03 AM, Marius Retegan <span dir="ltr"><<a href="mailto:marius.s.retegan@gmail.com">marius.s.retegan@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello<br>
I have simple text file that I have to parse. It looks something like<br>
this:<br>
<br>
parameters1<br>
     key1 value1<br>
     key2 value2<br>
end<br>
<br>
parameters2<br>
     key1 value1<br>
     key2 value2<br>
end<br>
<br>
So I want to create two dictionaries parameters1={key1:value1,<br>
key2:value2} and the same for parameters2.<br>
<br>
I woud appreciate any help that could help me solve this.<br>
Thank you<br>
<font color="#888888"><br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br>