[BangPypers] Question on Pattern Matching and Regular Expression

davidsnt davidsnt at gmail.com
Mon Jan 7 10:36:05 CET 2013


Bangpypers,

Having a little trouble in parsing a file of 702 line appox,

the file is in the format

#
# <Title>
#
[Space]
[

Few lines of information about the title

]

[Space]

#
# <Title>
#
[Space]
[

Few lines of information about the title

]

I want to read this file block by block, the need is build a data
structure(dictionary) with title as key and the information as values.


Example:

#
#Delhi
#

Population = 7cr
Temperature = 10 deg cel
Area = 13000 sqft

#
#Mumbai
#

Population = 10cr
Temperature = 30 deg cel
Area = 132000 sqft






Regards,
Davidsanthosh L


More information about the BangPypers mailing list