Skip to main content
Grammar, tags, markup, text.
Source Link
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k

how How to remove a specific JSON object from a file using cli?

following isI have the following JSON data in a file:

{
"packages": {
    "cc": {
        "name": "cc",
        "version": "3.1",
        "release": "0.4",
        "arch": "x86"
    },
    "code": {
        "name": "code",
        "version": "3.0",
        "release": "2.0.2",
        "arch": "x86"
    }
}
}
{
  "packages": {
    "cc": {
      "name": "cc",
      "version": "3.1",
      "release": "0.4",
      "arch": "x86"
    },
    "code": {
      "name": "code",
      "version": "3.0",
      "release": "2.0.2",
      "arch": "x86"
    }
  }
}

I want to remove the whole code object from the file. howHow can iI do that using a command-line tool?

how to remove JSON object from a file using cli

following is the JSON file:

{
"packages": {
    "cc": {
        "name": "cc",
        "version": "3.1",
        "release": "0.4",
        "arch": "x86"
    },
    "code": {
        "name": "code",
        "version": "3.0",
        "release": "2.0.2",
        "arch": "x86"
    }
}
}

I want to remove whole code object from file. how can i do that?

How to remove a specific JSON object from a file?

I have the following JSON data in a file:

{
  "packages": {
    "cc": {
      "name": "cc",
      "version": "3.1",
      "release": "0.4",
      "arch": "x86"
    },
    "code": {
      "name": "code",
      "version": "3.0",
      "release": "2.0.2",
      "arch": "x86"
    }
  }
}

I want to remove the whole code object from the file. How can I do that using a command-line tool?

added 1 character in body
Source Link

following is the JSON file:

{
"packages": {
    "cc": {
        "name": "cc",
        "version": "3.1",
        "release": "0.4",
        "arch": "x86"
    },
    "code": {
        "name": "code",
        "version": "3.0",
        "release": "2.0.2",
        "arch": "x86"
    }
}
}

I want to remove whole code object from file. how can i do that?

following is the JSON file:

{
"packages": {
    "cc": {
        "name": "cc",
        "version": "3.1",
        "release": "0.4",
        "arch": "x86"
    },
    "code": {
        "name": "code",
        "version": "3.0",
        "release": "2.0.2",
        "arch": "x86"
    }
}

I want to remove whole code object from file. how can i do that?

following is the JSON file:

{
"packages": {
    "cc": {
        "name": "cc",
        "version": "3.1",
        "release": "0.4",
        "arch": "x86"
    },
    "code": {
        "name": "code",
        "version": "3.0",
        "release": "2.0.2",
        "arch": "x86"
    }
}
}

I want to remove whole code object from file. how can i do that?

edited tags
Link
Jim L.
  • 8.8k
  • 1
  • 15
  • 29
Source Link
Loading