Convert INI to ENV

Turn INI files into Dotenv. Each top-level key becomes a KEY=value line, with characters a variable name cannot hold turned into underscores, and a top-level list numbers its entries from 0 under items, so the name of the first entry becomes items_0_name.

Converted in an isolated sandbox on our serversDeleted after 24 hours

Drop INI files on the dialor turn it to pick what to do

INI settings as environment variables.Each top-level key becomes a KEY=value line in one ENV file.

  1. What you get

    One ENV file with a KEY=value line for each top-level key. Characters that a variable name cannot hold are turned into underscores.

    Text with spaces or symbols is double-quoted with escapes. A null value leaves the value empty.

  2. Lists and nested values

    Nested objects and lists become quoted JSON text. The value holds the whole structure as JSON.

    A top-level list numbers its entries from 0 under items. The name of the first entry becomes items_0_name.

  3. Going the other way

    To turn KEY=value lines back into sections, use ENV to INI.

INI and ENV.What each format is.

The formats

From · INI

INI

Sections of key and value pairs, the settings format of Windows and many tools.

Extensions
.ini .cfg
MIME type
text/x-ini
Kind
Text and data
To · ENV

Dotenv

KEY=value lines that hold environment variables for an app.

Extensions
.env
MIME type
text/x-env
Kind
Text and data

In your code.The same INI to ENV conversion through the API, for your app or your agent.

terminal
$ cv convert report.ini report.env
$ cv convert report.ini report.env

Questions.What people ask about INI to ENV.

01OF 04

They are turned into underscores, so the name is a valid variable name.

Text with spaces or symbols is double-quoted with escapes.

They become quoted JSON text in the value.

A top-level list numbers its entries from 0 under items. The name of the first entry becomes items_0_name.

More conversions.Other ways in and out of INI and ENV.