Hi All,
Please accept my apologies, if this similar question has been asked
earlier, I tried to search over the stack network and googled but couldn't
find relevant information, partly may be because I may not be able to
search effectively.
I have built a contact form which sends me email for every user
registration My question is more related to parsing some text data into csv
format. and I have received multiple users information in my mail box which
I had copied into a text file. The data looks like below.
Name: testuser2
Email: [email protected]
Cluster Name: o b
Contact No.: 12346971239
Coming: Yes
Name: testuser3
Email: [email protected]
Cluster Name: Mediternea
Contact No.: 9121319107
Coming: Yes
Name: testuser4
Email: [email protected]
Cluster Name: Mediterranea
Contact No.: 7892174896
Coming: Yes
Name: tuser5
Email: [email protected]
Cluster Name: River Retreat A
Contact No.: 7583450912
Coming: Yes
Members Participating: 2
Name: Test User
Email: [email protected]
Cluster Name: RD
Contact No.: 09833123445
Coming: Yes
Members Participating: 2
As can see the data contains some common fields and some fields which are
not present, I am looking for solution/suggestion on how I can parse this
data so under the heading Name, I will collect the name information under
that column, and similarly for other, the data with title "Members
Participating" I can just pick the nos and add it into excel sheet under
the same heading, incase for the user this information is not present, it
can just go blank.
Stackoverflow link to this question:
http://stackoverflow.com/questions/31911191/parsing-data-from-text-file-to-python
Regards,
Om Prakash Singh
Live Curious
--
https://mail.python.org/mailman/listinfo/python-list