I'm working on a python(3.6) project in which I need to Parse a text file,
My specific problem is: My text file has some Headings like Examples, Input, Output, Explanations, Notes I need to parse this file and take input & Output headings after Examples headings and write them at end of this file mean after Notes heading and save the file.
Here's I'm trying to get the next line of Examples line:
count = 0
for root, dirs, files in os.walk(os.path.join('description2code_current')):
for file in files:
old_name = os.path.join(os.path.abspath(root), file)
print('File Path ````` is: ', old_name)
rf = open(old_name, "r")
lines = rf.readline()
for line in lines:
line = line.strip()
if line == 'Examples':
How can I make that change into my file and then parse it again to save data against these headings into my database?
Help me, please!
Thanks in advance!
Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered