15,910,981 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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
Member 13048699
9-Mar-17 10:53am
View
@Jochen Arndt Something I got in the meanwhile.
def process(line):
if line.startswith(' s_InfoDay day_stat[] = {'):
print line
with open("C:\..\test.c") as f:
for line in f:
process(line)
It just prints the line s_InfoDay day_stat[] = {. How do I perform processing on the array. Please advise me something.
Member 13048699
9-Mar-17 10:42am
View
@Jochen Arndt Currently i am able to print the opened file in python code. Unsure on how to implement the process() function. May you please help me?
Member 13048699
9-Mar-17 10:27am
View
Could you please provide me with some code layout as I am relatively new to python. I have experience mostly in C++. I would be grateful to you. I am sorry if I am troubling you but I am in real need of help.
Member 13048699
9-Mar-17 10:25am
View
I am not sure on what you mean by this: Declare and clear a variable indicating that the array is processed. Could you provide me with an example? Thanks in advance.
Member 13048699
9-Mar-17 9:45am
View
I want to be able to use python and not php here. Can you help me with a solution regarding python? I would be grateful to you.
Member 13048699
9-Mar-17 9:30am
View
The xml has the follwinf format. I could not past all of it above there.
<League name="PrimierLeague/Information/**STAT**" TeamType="Team" visibility="false">
<description>**Level**
<target><property>
<Info type="String">EMPTY
</League >
Show More