Find the First Definition of a Duplicate INI Key
Admin ·
When a setting appears twice, the duplicate line alone may not tell you which value to keep. Compare it with the first definition and check whether your reader considers letter case significant.
Find three issues in Literal INI
Load the example and select Validate INI. Line 4 repeats Code, first defined at line 2, column 1. Line 5 has an unclosed section header and line 6 needs an equals sign or a colon.
Choose the Code assignment your application should keep, close the night header with a right bracket, then add a separator to Timeout. The lowercase code on line 3 is distinct in Literal INI.
Freedesktop Desktop Entry Specification, case-sensitive keys and groupsPython ConfigParser, supported keys and values
Compare the same source in ConfigParser mode
Switch the original sample to ConfigParser-style raw INI. There are four issues because line 3 also duplicates line 2 after case folding. Correct the duplicate according to what the receiving application expects.
ConfigParser-style raw INI allows deeper-indented lines to continue the current value. Literal INI reads one value per line and also allows assignments before the first section.
Use the report with your original file
Download ini-validation.json. It lists the dialect, source byte count, physical line count and positions. Each duplicate also includes a first-definition position. Columns start at one and count UTF-16 code units from the start of the line after any leading BOM.
Validate the edited file again. A syntax pass shows that it follows the selected structure. Check field requirements or application-specific interpolation separately.
Python ConfigParser, supported keys and valuesPHP INI scanner syntax and modes
Common questions
Can the same key occur in two different sections?
Yes. Key comparisons apply within one section, or within the global assignments in Literal INI.
Does a lone trailing quote cause an error?
Quotes are literal characters in these dialects. Any requirement for matched quotes belongs to the receiving application’s syntax.