Click here to Skip to main content
15,910,981 members

Comments by Member 13048699 (Top 11 by date)

Member 13048699 9-Mar-17 13:19pm View    
I just posted my solution below. It does not seem to work. Could you please help?
Member 13048699 9-Mar-17 13:17pm View    
Deleted
@Jochen Arndt

In the meanwhile, I tried something like this:

xml = """
<League name="PrimierLeague/Information/{level}" TeamType="Team" visibility="false">
<description>{stat}
<target><property>
<Info type="String">EMPTY
</League >
"""

with open("C:\..\test.c") as f:
for line in f:
match = re.match(r"{(.*?),(.*?),(.*?),(.*?)}", line)
if match:
rank = match.group(1).strip()
stat = match.group(2).strip()
level = match.group(3).strip()
stance = match.group(4).strip()

if stat == "NULL":
stat = None
else:
stat = stat[1:-1]

if level == "NULL":
level = None
else:
level = level[1:-1]

print(xml.format(stat=stat, level=level))

But it compiles but it does not print the xml sturcture.
Member 13048699 9-Mar-17 13:16pm View    
Deleted
In the meanwhile, I tried something like this:

xml = """
<League name="PrimierLeague/Information/{level}" TeamType="Team" visibility="false">
<description>{stat}
<target><property>
<Info type="String">EMPTY
</League >
"""

with open("C:\..\test.c") as f:
for line in f:
match = re.match(r"{(.*?),(.*?),(.*?),(.*?)}", line)
if match:
rank = match.group(1).strip()
stat = match.group(2).strip()
level = match.group(3).strip()
stance = match.group(4).strip()

if stat == "NULL":
stat = None
else:
stat = stat[1:-1]

if level == "NULL":
level = None
else:
level = level[1:-1]

print(xml.format(stat=stat, level=level))
Member 13048699 9-Mar-17 11:42am View    
I dont understand why would this be in an elif statement.
elif line.startswith(' s_InfoDay day_stat[] = {'):
isProcessing = True
Member 13048699 9-Mar-17 11:40am View    
Deleted
i dont understand why do you do this.
if stat == "NULL":
return False