Hi, I am trying to read object information from a text file (approx. 30,000 lines) with the following format, each line corresponds to a line in the text file. Currently, the whole file was read into a string list using readlines(), then use for loop to search the "= {" and "};" to determine the Object, SubObject,and SubSubObject. My questions are
1) Is there any efficient method that I can search the whole string list to find the location of the tokens(such as '= {' or '};' 2) Is there any efficient ways to extract the object information you may suggest? Thanks, - Jeremy ===== Structured text file ================= Object1 = { ... SubObject1 = { .... SubSubObject1 = { ... }; }; SubObject2 = { .... SubSubObject21 = { ... }; }; SubObjectN = { .... SubSubObjectN = { ... }; }; }; -- http://mail.python.org/mailman/listinfo/python-list