I'm new here and also new to python so I'm struggling with a simple task that i hope you can help me with.
I have a text file that contains data in the following format:
<add key="DateFormat" value="dd-MMM-yyyy"/>
<add key="JsDateFormat" value="DD-MMM-YYYY"/>
<add key="dbDateFormat" value="dd-MMM-yyyy HH:mm:ss:fff"/>
What I want to do is to read and print the lines that contain certain keys, for example DateFormat and dbDateFormat and print their values.
I am reading files using:
f = open("file.config", "r")
file = f.read()
print(file)
It reads the whole file as expected, but I don't know how to make it search and print with the conditions described above.
I will highly appreciate any help.