Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. CTSQLGUY

    Carriage Returns are Killing my Script - Assistance Required

    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...
  2. CTSQLGUY

    Carriage Returns are Killing my Script - Assistance Required

    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!
  3. CTSQLGUY

    Carriage Returns are Killing my Script - Assistance Required

    ...my $description = ''; if ($record =~ /^\s+DESCRIPTION\n\s+"(.*?)"$/m) { $description = $1; } ------------------------------------------------------------------------------------- That works fine as long as the description is a single line – it captures nothing if...
  4. CTSQLGUY

    Assistance capturing multiple lines...

    Oops I didn't see Millers update before my last post, I just tried it and that's 100%! Thanks again all!
  5. CTSQLGUY

    Assistance capturing multiple lines...

    ...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 =~ s/\s+/ /g; #...
  6. CTSQLGUY

    Assistance capturing multiple lines...

    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...
  7. CTSQLGUY

    Assistance capturing multiple lines...

    Thanks Miller - that was 100% what I needed! Thanks everyone else for the help!
  8. CTSQLGUY

    Assistance editing a script to parse out some numbers...

    Miller - you've done it again! Thanks a ton everyone for your help - it's greatly appreciated! :D
  9. CTSQLGUY

    Assistance capturing multiple lines...

    ...Right now this is what that line looks like: --------------------------------------------------------- if ($record =~ /^\s+DESCRIPTION\n\s+"(.*?)"$/m) { --------------------------------------------------------- So I should change it to the following...
  10. CTSQLGUY

    Assistance capturing multiple lines...

    ...script: ----------------------------------------------------------- my $description = ''; if ($record =~ /^\s+DESCRIPTION\n\s+"(.*?)"$/m) { $description = $1; } else { print OUTFILE "Error: Description not found in record - $record"; }...
  11. CTSQLGUY

    Assistance editing a script to parse out some numbers...

    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...
  12. CTSQLGUY

    Adding a header and trailer...

    Success! Thanks! :)
  13. CTSQLGUY

    Adding a header and trailer...

    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...
  14. CTSQLGUY

    Adding a header and trailer...

    ...if (/^(\w+)\s+(?:NOTIFICATION|TRAP)-TYPE/) { my $object = $1; # Get Entire Record. my $record = $_; until (/^\s*$/ || eof(INFILE)) { $record .= $_ = <INFILE>; } # Parse for Data my $variables = ''; if ($record =~...
  15. CTSQLGUY

    Perl Script for MIB Conversion...

    It wasn't a waste at all - I wasn't aware that was your goal. I hope you weren't insulted... Thanks again for the help everyone.
  16. CTSQLGUY

    Perl Script for MIB Conversion...

    Anything...?
  17. CTSQLGUY

    Perl Script for MIB Conversion...

    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...
  18. CTSQLGUY

    Perl Script for MIB Conversion...

    Ummm... disregard, I re-read the original post - sorry and thanks for the help!
  19. CTSQLGUY

    Perl Script for MIB Conversion...

    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...
  20. CTSQLGUY

    Perl Script for MIB Conversion...

    ...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 make it do that within the script? Even better...

Part and Inventory Search

Back
Top