Convert PROPERTIES to ENV

Turn PROPERTIES 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 PROPERTIES files on the dialor turn it to pick what to do

Properties turned into a dotenv file.Each 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, so the names work as environment variable names.

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

  2. Nested values and lists

    Nested objects and lists become quoted JSON text. They stay in one value instead of becoming separate variables.

    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 a dotenv file back into properties, use ENV to PROPERTIES.

PROPERTIES and ENV.What each format is.

The formats

From · PROPERTIES

Java Properties

Key and value pairs in the Java properties format.

Extensions
.properties
MIME type
text/x-java-properties
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 PROPERTIES to ENV conversion through the API, for your app or your agent.

terminal
$ cv convert report.properties report.env
$ cv convert report.properties report.env

Questions.What people ask about PROPERTIES to ENV.

01OF 04

Characters a variable name cannot hold are turned into underscores. The rest of the name is kept.

They are double-quoted with escapes.

The value is left empty.

Its entries are numbered from 0 under items. The name of the first entry becomes items_0_name.

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