Skip to main content
Easier to read formatting
Source Link
"crosshair"                                                   
{
    "file"          "materials/crosshair"
    "x"             "32"
    "y"             "32"
    "width"         "32"
    "height"        "32"
}

"autoaim"
{
              ...
              "autoaim"
              {
  }
}
"crosshair"                                                   
{
    "file"          "materials/crosshair"
    "x"             "32"
    "y"             "32"
    "width"         "32"
    "height"        "32"
}

"autoaim"
{
              ...
              "autoaim"
              {
  }
}
Easier to read formatting
Source Link
WeaponData
{
    TextureData
    {
                "crosshair"
                {
                                "file"  "vgui/replay/thumbnails/"
                                "x"             "0"
                                "y"             "0"
                                "width"         "64"
                                "height"        "64"
                }
                "weapon"
                {
                                "file"          "sprites/bucket_bat_red"
                                "x"             "0"
                                "y"             "0"
                                "width"         "200"
                                "height"                "128"
                }
                "weapon_s"
                {       
                                "file"          "sprites/bucket_bat_blue"
                                "x"             "0"^M"0"
                                "y"             "0"^M"0"
                                "width"         "200"^M"200"
                                "height"                "128"
                }

                "ammo"
                {^M
                                "file"          "sprites/a_icons1"
                                "x"             "55"^M"55"
                                "height"    "15"
                }

                "crosshair"
                {
                    "file"      "sprites/crosshairs" <---
                    "x"     "32"
                    "y"     "32"
                    "width"     "32"
                    "height"    "32"
                }

                "autoaim"
                {
                    "file"      "sprites/crosshairs"
                    "x"     "0"
                    "y"     "48"
                    "width"     "24"
                    "height"    "24"
                }
    }
}
WeaponData
{
    TextureData
    {
                "crosshair"
                {
                                "file"  "vgui/replay/thumbnails/"
                                "x"             "0"
                                "y"             "0"
                                "width"         "64"
                                "height"        "64"
                }
                "weapon"
                {
                                "file"          "sprites/bucket_bat_red"
                                "x"             "0"
                                "y"             "0"
                                "width"         "200"
                                "height"                "128"
                }
                "weapon_s"
                {       
                                "file"          "sprites/bucket_bat_blue"
                                "x"             "0"^M
                                "y"             "0"^M
                                "width"         "200"^M
                                "height"                "128"
                }

                "ammo"
                {^M
                                "file"          "sprites/a_icons1"
                                "x"             "55"^M
                "height"    "15"
        }

        "crosshair"
        {
                "file"      "sprites/crosshairs"
                "x"     "32"
                "y"     "32"
                "width"     "32"
                "height"    "32"
        }

        "autoaim"
        {
                "file"      "sprites/crosshairs"
                "x"     "0"
                "y"     "48"
                "width"     "24"
                "height"    "24"
        }
    }
}
WeaponData
{
    TextureData
    {
                "crosshair"
                {
                                "file"  "vgui/replay/thumbnails/"
                                "x"             "0"
                                "y"             "0"
                                "width"         "64"
                                "height"        "64"
                }
                "weapon"
                {
                                "file"          "sprites/bucket_bat_red"
                                "x"             "0"
                                "y"             "0"
                                "width"         "200"
                                "height"                "128"
                }
                "weapon_s"
                {       
                                "file"          "sprites/bucket_bat_blue"
                                "x"             "0"
                                "y"             "0"
                                "width"         "200"
                                "height"                "128"
                }

                "ammo"
                {
                                "file"          "sprites/a_icons1"
                                "x"             "55"
                                "height"    "15"
                }

                "crosshair"
                {
                    "file"      "sprites/crosshairs" <---
                    "x"     "32"
                    "y"     "32"
                    "width"     "32"
                    "height"    "32"
                }

                "autoaim"
                {
                    "file"      "sprites/crosshairs"
                    "x"     "0"
                    "y"     "48"
                    "width"     "24"
                    "height"    "24"
                }
    }
}
added 636 characters in body
Source Link
WeaponData
{
    TextureData
    {
                "crosshair"
                {
                                "file"  "vgui/replay/thumbnails/"
                                "x"             "0"
                                "y"             "0"
                                "width"         "64"
                                "height"        "64"
                }
                "weapon"
                {
                                "file"          "materials"sprites/crosshair"bucket_bat_red"
                                "x"             "32""0"
                                "y"             "32""0"
                                "width"         "32""200"
                                "height"        "32"        "128"
                }
                "weapon_s"
"crosshair"                {       
                                "file"          "sprites/bucket_bat_blue"
                                "x"             "0"^M
                                "y"             "0"^M
                                "width"         "200"^M
                                "height"                "128"
                }

                "ammo"
                {^M
                                "file"          "sprites/crosshairs"a_icons1"
    <---
                            "x"             "55"^M
                "height"    "15"
        }

        "crosshair"
        {
                "file"      "sprites/crosshairs"
                "x"     "32"
    "y"            "y"     "32"
                "width"     "32"
                "height"    "32"
        }

        "autoaim"
        {
                "file"      "sprites/crosshairs"
                "x"     "0"
                "y"     "48"
                "width"     "24"
                "height"    "24"
    "32"    }
    }
}

This cannot be removed. I DEEPLY apologize for not explaining this earlier, but I did not think it would be necessary.

don_crissti's suggestion works quite well which is sed '/crosshair/,/\}/{H;/\}/!d;s/.*//;x;/sprites\/crosshairs/d;s/.//;}' infile

The output is this, however:

"crosshair"                                                   
{
    "file"          "materials/crosshair"
    "x"             "32"
    "y"             "32"
    "width"         "32"
    "height"        "32"
}

"autoaim"
{

"autoaim" is partially deleted, but not completely, but as you can see the block containing "sprites/crosshairs" is removed, as I wanted to do, but autoaim still cannot be modified

"crosshair"                                                   
{
    "file"          "materials/crosshair"
    "x"             "32"
    "y"             "32"
    "width"         "32"
    "height"        "32"
}

"crosshair"                                                   
{
    "file"          "sprites/crosshairs"    <---
    "x"             "32"
    "y"             "32"
    "width"         "32"
    "height"        "32"
}

This cannot be removed. I DEEPLY apologize for not explaining this earlier, but I did not think it would be necessary.

WeaponData
{
    TextureData
    {
                "crosshair"
                {
                                "file"  "vgui/replay/thumbnails/"
                                "x"             "0"
                                "y"             "0"
                                "width"         "64"
                                "height"        "64"
                }
                "weapon"
                {
                                "file"          "sprites/bucket_bat_red"
                                "x"             "0"
                                "y"             "0"
                                "width"         "200"
                                "height"                "128"
                }
                "weapon_s"
                {       
                                "file"          "sprites/bucket_bat_blue"
                                "x"             "0"^M
                                "y"             "0"^M
                                "width"         "200"^M
                                "height"                "128"
                }

                "ammo"
                {^M
                                "file"          "sprites/a_icons1"
                                "x"             "55"^M
                "height"    "15"
        }

        "crosshair"
        {
                "file"      "sprites/crosshairs"
                "x"     "32"
                "y"     "32"
                "width"     "32"
                "height"    "32"
        }

        "autoaim"
        {
                "file"      "sprites/crosshairs"
                "x"     "0"
                "y"     "48"
                "width"     "24"
                "height"    "24"
        }
    }
}

This cannot be removed. I DEEPLY apologize for not explaining this earlier, but I did not think it would be necessary.

don_crissti's suggestion works quite well which is sed '/crosshair/,/\}/{H;/\}/!d;s/.*//;x;/sprites\/crosshairs/d;s/.//;}' infile

The output is this, however:

"crosshair"                                                   
{
    "file"          "materials/crosshair"
    "x"             "32"
    "y"             "32"
    "width"         "32"
    "height"        "32"
}

"autoaim"
{

"autoaim" is partially deleted, but not completely, but as you can see the block containing "sprites/crosshairs" is removed, as I wanted to do, but autoaim still cannot be modified

added 330 characters in body
Source Link
Loading
added 10 characters in body; edited tags; edited title
Source Link
don_crissti
  • 85.7k
  • 31
  • 234
  • 263
Loading
added 13 characters in body
Source Link
Loading
improved(maybe) even further
Source Link
Loading
improved(?) after reading comments
Source Link
Loading
Source Link
Loading