0

I want to get all the fields under a Section in a config file into a list. Problem with ConfigParser is, it does not allow duplication of Options.Is it possible to use ConfigParser to do so or do I need to read the whole file and put the fields of a Section line by line? Below is not exact data but similar:

[Data]
Version   = 2.0
Length    = 14 
ID        = 1123
Signature = ABCD
ID        = XYZ     

Also tried with configparser's strict=False, but it is not working.

Ron
  • 51
  • 1
  • 1
  • 5
  • 1
    Please show us an example config file that demonstrates the issue. – Brian Rodriguez Apr 04 '17 at 12:08
  • Possible duplicate of [Handling duplicate keys with ConfigParser](http://stackoverflow.com/questions/13921323/handling-duplicate-keys-with-configparser) – Jagoda Gorus Apr 04 '17 at 12:30
  • Please check out those questions: [configparser-duplicate-keys-in-python](http://stackoverflow.com/questions/30095471/configparser-duplicate-keys-in-python) and [handling-duplicate-keys-with-configparser](http://stackoverflow.com/questions/13921323/handling-duplicate-keys-with-configparser) – Jagoda Gorus Apr 04 '17 at 12:31
  • @JagodaSokół, Those solutions did not solve my problem. – Ron Apr 04 '17 at 13:29

0 Answers0