The Set|File Site

Set|File - Quick Start

Learn Set files in 5 minutes


What is a Set File?

A Set file is a human-readable text file for storing settings and configuration data.
One very flexible protocol which can be used reliably in many ways.
Typically saved with the ending .set
or for a simplified or "quick" version .qset


The Absolute Minimum

1. Create a File

myconfig.set

That's the filename on the first line. That's it, no data but it is a set file.

2. Add a Group

Groups are sections that hold related data. Start with [GROUPNAME]:

myconfig.set

[DATABASE]
Host|localhost
Port|5432
User|admin

Rules:

3. Done!

That's a valid Set file. You can read it, edit it, parse it.


Two Ways to Understand Data Storage

But only one format!

Key-Value Pairs (Settings)

[SETTINGS]
AppName|My App
Theme|dark
Language|en-US

Use for: Configuration, preferences, simple settings

Tables (Multiple Records)

[USERS]
{id|name|email}
1|Alice|alice@example.com
2|Bob|bob@example.com
3|Carol|carol@example.com

The {field|names} line is optional but helpful.

Use for: Lists, tables, structured data


Multi-Line Text

For long text (descriptions, licenses, etc.), use text blocks:

[APP_INFO]
Name|My Application
Description|[{APP_DESCRIPTION}]

[{APP_DESCRIPTION}]
This is my application.

It does many things across
multiple lines of text.

No escaping needed!
[EOG]

Text blocks:


Escaping the Delimiter

If your data contains a pipe | just escape it with backslash:

[DATA]
Expression|value > 10 \| value < 5

the Key is "Expression" and the Value is "value > 10 | value < 5"
the excaped pipe is ignored during parsing.
That's the only escape you need.


Comments

Any text outside groups is a comment:

myconfig.set

This is a comment.
It explains what this file does.

[SETTINGS]
Port|8080

Complete Minimal Example

myconfig.set

Application configuration
Created: 2025-11-27

[DATABASE]
Host|localhost
Port|5432
Database|myapp

[SETTINGS]
Theme|dark
Language|en-US
MaxUsers|50

[USERS]
{id|name|email}
1|alice|alice@example.com
2|bob|bob@example.com

[{WELCOME_MESSAGE}]
Welcome to My Application!

Get started by configuring your settings above.
[EOG]

Parsing (Pseudocode)

# Read the file
lines = read_file("myconfig.set")

# Find groups
for line in lines:
    if line.startswith('[') and not line.startswith('[{'):
        group_name = extract_name(line)
        # Collect data until blank line or next group

    elif line.startswith('[{'):
        text_block_name = extract_name(line)
        # Collect all text until [EOG] or blank line

That's it.
Split lines on | (pipe-delimited array) store in a dictionary or object.


That's Everything You Need to Get Started

With just these basics you can:


Want More?

Additional features (all optional):

See the Specifications for details.


Rules Summary

  1. Filename on first line (optional but recommended)
  2. Groups start with [NAME]
  3. Data separated by | pipe
  4. Text blocks use [{NAME}] for multi-line content
  5. Escape pipes in data with \|
  6. Comments are any text outside groups
  7. Blank lines end groups (or use [EOG])
  8. End of File use [EOF], recommended, not required

Start Using Set Files in 30 Seconds

  1. Create myfile.set
  2. Add [SETTINGS]
  3. Add Key|Value pairs
  4. Done!

Next Steps


← Back to Home



Page last modified on December 03, 2025, at 09:37 PM