Dasel
v2
v2
  • Introduction
  • GitHub
  • Supported file formats
  • Memory usage
  • Installation
  • Commands
    • Select
    • Put
    • Delete
  • Functions
    • Selector Overview
    • All
    • And
    • Append
    • Count
    • Equal
    • Filter
    • FilterOr
    • First
    • Index
    • Join
    • Key
    • Keys
    • Last
    • Len
    • LessThan
    • MapOf
    • Merge
    • MoreThan
    • Not
    • Or
    • OrDefault
    • Parent
    • Property
    • String
    • Null
    • This
    • Type
  • Examples
    • Using dasel as a go package
    • Basics
    • Change file format
    • Filtering objects based on present/missing key
Powered by GitBook
On this page
  • Usage
  • Flags/Args
Edit on GitHub
  1. Commands

Delete

PreviousPutNextSelector Overview

Last updated 1 year ago

The delete command allows you to delete data in any supported data structure.

Usage

$ echo '{"name":{"first":"Tom","last":"Wright"}}' |
  dasel delete -r json 'name.last'
{
  "name": {
    "first": "Frank"
  }
}

See the for information on the available selectors.

Flags/Args

Flag
Type
Description
Default

--colour

bool

Print colourised output.

false

--escape-html

bool

Escape HTML tags when writing output.

false

-f, --file

string

The file to query. If no file is given dasel reads from stdin.

-o, --out

string

The file to write results to. If no file is given dasel writes to --file. If --file is stdin, dasel writes to stdout.

--pretty

bool

Pretty print the output.

true

-r, --read

string

The parser to use when reading. If no parser is given dasel attempts to find a parser from the --file flag.

-s, --selector

string

The selector used to query the input data. If no flag is given dasel attempts to use the first argument as the selector.

-w, --write

string

The parser to use when writing. If no parser is given dasel attempts to find a parser from the --out flag. If no --out flag is given dasel uses the --read flag.

--csv-comma

string

The separator used when working with csv files.

,

--csv-write-comma

string

The separator used when writing csv files.

value of --csv-comma

--csv-comment

string

The comment character used when working with csv files.

--csv-crlf

bool

True to write csv files with a \r\n instead of \n.

false

function documentation