I would like to remove contents of a file from a certain character to a certain character in the file in Perl. How do I do that using a script?
The file has this:
Syslog logging: enabled (11 messages dropped, 2 messages rate-limited,
0 flushes, 0 overruns, xml disabled, filtering disabled)
Console logging: level informational, 81 messages logged, xml disabled,
filtering disabled
Monitor logging: level debugging, 0 messages logged, xml disabled,
filtering disabled
Buffer logging: level informational, 28 messages logged, xml disabled,
filtering disabled
Logging Exception size (4096 bytes)
Count and timestamp logging messages: disabled
No active filter modules.
Trap logging: level informational, 83 message lines logged
Log Buffer (4096 bytes):
*Oct 4 13:42:03.210: %SEC_LOGIN-5-LOGIN_SUCCESS: Login Success [user: ] [Source: ] [localport: ] at UTC Mon Oct 4 2010
And the new file after the trimming should be this
*Oct 4 13:42:03.210: %SEC_LOGIN-5-LOGIN_SUCCESS: Login Success [user: ] [Source: ] [localport: ] at UTC Mon Oct 4 2010