Re: python3 regex?

2016-09-10 Thread Doug OLeary
Hey, all; thanks for the replies - reading data in one slurp vs line by line was the issue. In my perl programs, when reading files, I generally do it all in one swell foop and will probably end up doing so again in this case due to the layout of the text; but, that's my issue. Thanks again.

iterating over multi-line string

2016-09-11 Thread Doug OLeary
Hey; I have a multi-line string that's the result of reading a file filled with 'dirty' text. I read the file in one swoop to make data cleanup a bit easier - getting rid of extraneous tabs, spaces, newlines, etc. That part's done. Now, I want to collect data in each section of the data. Sec

Re: iterating over multi-line string

2016-09-11 Thread Doug OLeary
Hey; Never mind; I finally found the meaning of stopiteration. I guess my google-foo is a bit weak this morning. Thanks Doug -- https://mail.python.org/mailman/listinfo/python-list

more python3 regex?

2016-09-11 Thread Doug OLeary
Hey This one seems like it should be easy but I'm not getting the expected results. I have a chunk of data over which I can iterate line by line and print out the expected results: for l in q.findall(data): # if re.match(r'(Name|")', l): # continue print(l) $ ./testies.py | wc -l 1

Re: more python3 regex?

2016-09-11 Thread Doug OLeary
Hey, all; The print suggestion was the key clue. Turned out my loop was slurping the whole of data in one big line. Searching for a line that begins with Name when it's in the middle of the string is... obviously not going to work so well. Took me a bit to get that working and, once I did, I

xml parsing with lxml

2016-10-07 Thread Doug OLeary
Hey; I'm trying to gather information from a number of weblogic configuration xml files using lxml. I've found any number of tutorials on the web but they all seem to assume a knowledge that I apparently don't have... that, or I'm just being rock stupid today - that's distinct possibility too.

Re: xml parsing with lxml

2016-10-07 Thread Doug OLeary
On Friday, October 7, 2016 at 3:21:43 PM UTC-5, John Gordon wrote: > root = doc.getroot() > for child in root: > print(child.tag) > Excellent! thank, you sir! that'll get me started. Appreciate the reply. Doug O'Leary -- https://mail.python.org/mailman/listinfo/python-list

lxml and xpath(?)

2016-10-24 Thread Doug OLeary
Hey; Reasonably new to python and incredibly new to xml much less trying to parse it. I need to identify cluster nodes from a series of weblogic xml configuration files. I've figured out how to get 75% of them; now, I'm going after the edge case and I'm unsure how to proceed. Weblogic xml conf