Kevin,
That's *very close* - the one thing I need to happen though is for the message to end up on a single line... I'm not sure how to make that happen.
*shrug*
This is my output:
-------------------------------------------------
message = The process count monitor threshold has...
Thanks, but the text string will change - sorry if I was to general but I have multiple records I'm going to be running this through and all I need to focus on is the text between the quotes...
Thanks though!
I’m running into issues because of carriage returns and need some assistance…
I’m using this to capture the description:
-------------------------------------------------------------------------------------
my $description = '';
if ($record =~ /^\s+DESCRIPTION\n\s+"(.*?)"$/m) {...
That did it... this is what I ended up using:
------------------------------------
my $description = '';
if ($record =~ /^\s+DESCRIPTION\n\s+"(.*?)"$/ms) {
$description = $1;
$description =~ s/\n/ /g; # Strip any returns.
$description =~...
Actually.. I just noticed it isn't removing the returns, it is, but it's leaving gaps in between - this was copied from the output:
--------------------------------------------------------
message = This trap signifies that the SonicWALL appliance is re-initializing itself such...
I'm sorry... I don't understand.
Right now this is what that line looks like:
---------------------------------------------------------
if ($record =~ /^\s+DESCRIPTION\n\s+"(.*?)"$/m) {
---------------------------------------------------------
So I should change it to the following...
I have a script that is only able to capture one line at a time - I need it to be able to capture ALL of my data between the quotes.
Here is the script:
-----------------------------------------------------------
my $description = '';
if ($record =~...
Hello!
I have a script that needs some tweaking.
Right now, I have the script grabbing a number of different lines from one file and inserting them into another.
Now what I need is to be able to grab ONLY the last digits and insert them into my file.
Here is an example of what I need to...
Thanks Miller, but that script isn't outputting anything for me... I'm getting the following error via command:
I've gone through the script and I'm not sure what the issue is... any idea?
Thanks!
------------------------------------------------------------
C:\Test>perfect.pl
syntax error at...
I have a script that I would like to make a slight change to. Currently, it is doing almost exactly what I want, however, at the beginning and end of it I want to add an open and close and am not sure how to do it.
If someone can point me in the right direction, as to what minor changes I would...
OK....
My output file is MUCH more different than the original now.
Original Output:
------------------------------------------------------------
<profiles> overwrite
<.1.3.6.1.4.1.2636>
name = Nortel Contivity TrapsV1
active = yes
<netscreenTrapHw>
trap_type = 6...
So it should look like this?
I'm receiving numerous errors...
**************************************************************
use strict;
my $infile = 'traps.mib'; # 'c:\Test\TRAPS.mib';
open(INFILE, "$infile") or die "Can't open $infile: $!";
open(OUTFILE, "c:\test\snmp.cfx") or die "can't...
Thank you so much for the cleaned up script, however I'm still not sure how to make it so it automatically outputs the file to an SNMP.CFX filed...
Right now I run the script from command like this:
*****************************
script.pl > SNMP.CFX
*****************************
How do I...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.