I'm new to Perl and I'd like to replace a text from this
<!-- kv3 encoding:text:version{e21c7f3c-8a33-41c5-9977-a76d3a32aa0d} format:generic:version{aafc65d8-7a5a-4e01-bd8d-3ac118422503} -->
{
_class = "CParticleSystemDefinition"
m_bShouldHitboxesFallbackToRenderBounds = false
m_nMaxParticles = 1
m_nInitialParticles = 1
m_flConstantRadius = 15.000000
m_ConstantColor =
[
255,
0,
0,
255,
]
m_nConstantSequenceNumber = 8
m_nConstantSequenceNumber1 = 7
m_Renderers =
[
{
_class = "C_OP_RenderSprites"
m_nSequenceCombineMode = "SEQUENCE_COMBINE_MODE_USE_SEQUENCE_0"
m_bMod2X = true
m_bDisableZBuffering = true
m_hTexture = resource:"materials/particle/particle_modulate_01.vtex"
m_nOrientationType = 2
},
]
}
To this.
<!-- kv3 encoding:text:version{e21c7f3c-8a33-41c5-9977-a76d3a32aa0d} format:generic:version{aafc65d8-7a5a-4e01-bd8d-3ac118422503} -->
{
_class = "CParticleSystemDefinition"
}
This is the command I've been using:
perl -pi.bak -e "s/CParticleSystemDefinition"/CParticleSystemDefinition"\n}/g;" "C:\Folder\File.vpcf"
and it has been producing this result for me
<!-- kv3 encoding:text:version{e21c7f3c-8a33-41c5-9977-a76d3a32aa0d} format:generic:version{aafc65d8-7a5a-4e01-bd8d-3ac118422503} -->
{
_class = "CParticleSystemDefinition"
}
m_bShouldHitboxesFallbackToRenderBounds = false
m_nMaxParticles = 1
m_nInitialParticles = 1
m_flConstantRadius = 15.000000
m_ConstantColor =
[
255,
0,
0,
255,
]
m_nConstantSequenceNumber = 8
m_nConstantSequenceNumber1 = 7
m_Renderers =
[
{
_class = "C_OP_RenderSprites"
m_nSequenceCombineMode = "SEQUENCE_COMBINE_MODE_USE_SEQUENCE_0"
m_bMod2X = true
m_bDisableZBuffering = true
m_hTexture = resource:"materials/particle/particle_modulate_01.vtex"
m_nOrientationType = 2
},
]
}
So, how do I make it so that replacing something deletes everything that comes after it? I'd also like to keep the command on a single line.