INI Formatear Referencia
El INI configuración archivo formatear: sections, claves, valores, comments, y dialect variations.
Core Syntax
The INI format is an informal configuration format consisting of sections in square brackets and key-value pairs separated by equals signs or colons. Comments begin with semicolons or hash signs and are ignored by parsers. The format predates any formal standard, so every parser implements a slightly different dialect. Despite this, INI remains popular for simple configuration due to its minimal syntax.
- section
- Bracketed header grouping keys
- key=value
- Assignment within a section
- comment
- Line starting with ; or #
- default section
- Keys before any section header
[database] port = 5432 ; a comment root-only keys Dialect Differences
Some parsers support duplicate keys by keeping the last or merging values, while others reject them. Multiline values are handled differently: some use continuation backslashes, others allow raw newlines. Quoting of values varies, with some dialects stripping quotes and others treating them literally. Interpolation of variables referencing other keys is a common non-standard extension. These differences make cross-tool portability unreliable.
Limitations
INI lacks a standard type system, so all values are strings until the application interprets them. Nested structures are not supported natively, though dotted keys are sometimes used as a convention. Binary and large data do not fit well in the line-oriented format. For complex configuration, TOML or YAML are better choices, but INI remains useful for flat, simple settings where minimalism is valued.