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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by Hemulll

  1. Hemulll

    SNMP hrSystemDate convert to time format

    Found solution <code> $octets = $srvTime; $octets =~ s/ //g; $octets = pack "H*", $octets; @date = unpack 'n C6 a C2', $octets; #print Dumper "DEBUG :: @date\n"; print Dumper $datetime = sprintf "%04d-%02d-%02d %02d:%02d:%02d", @date; </code>
  2. Hemulll

    SNMP hrSystemDate convert to time format

    Hello All. In Host Resources MIB file has hrSystemDate attribute, that show localtime of server. It possible to get this attribute via SNMP (1.3.6.1.2.1.25.1.2 OID). My problem is: values are in HEX, so, it possible to convert it to string ? or some understandable format ? Examples of HEX...
  3. Hemulll

    Perl Hash of arrays

    Thank you Franco for your prompt response!
  4. Hemulll

    Perl Hash of arrays

    Hello All, I solve this problem with foreach $key (sort keys %MSS) { my %uniq = map { $_ => 1 } (@{$MSS{$key}}); my @uniqArr = sort keys %uniq; print "\nHierarchicalGroup $key children "; print WRITE "\nHierarchicalGroup $key children "; foreach (@uniqArr) { #print "$_ "; print...
  5. Hemulll

    Perl Hash of arrays

    Hello All. I have aditional question about: push @{$x{$arr[0]}}, $arr[1]; This array may be non Uniq, how can I sort this array to Uniq array ? Can i use Map function for this ?
  6. Hemulll

    Perl Hash of arrays

    Thank you Kevin.
  7. Hemulll

    Perl Hash of arrays

    Hello feherke! Thank you for prompt response!!! This is my final code. while (<FILE>) { chomp; # assuming you not want to keep the ending newline next if $_ =~ m/^\s*$/; # skip blank lines (*) next if $_ =~ m/^,*$/; # (*) my @arr = split(/;/, $_); push...
  8. Hemulll

    Perl Hash of arrays

    Hi Feherke. Exactly so, bu i need to create this Hash from Data. For example i Read this file in my script, and create Hash from . I have a trouble with create Uniq hash . open(FILE, "data.csv") || die("Could not open file!"); my %x = (); while (<FILE>) { next if $_ =~ m/^(\s)*$/; # skip...
  9. Hemulll

    Perl Hash of arrays

    Hello All. How can create from this List Hash with Uniq Key "MSS1" and list values ATS1,ATS2 ... MSS1;ATS1 MSS1;ATS2 MSS1;ATS3 MSS1;ATS4 MSS2;ATS5 MSS2;ATS6 In my Script i create Hash, but in the Key use only one element of first line, cause this non Uniq. Please Help ...
  10. Hemulll

    Perl read block of file

    Thank you Kevin I will try to write this functional with this module
  11. Hemulll

    Perl read block of file

    Thanks All.
  12. Hemulll

    Perl read block of file

    Hi rharsh! Thank you for response! My issue is how to write this modified file to new one with same structure.
  13. Hemulll

    Perl read block of file

    Hello rharsh Thank you for response. I have another question about edge: block, how can i add line to edge block after data manipulation? For example in each edge: block line number 4 has ip addresses, i need to do something with this data and after data manupulation add something to edge...
  14. Hemulll

    Perl read block of file

    Hello Kevin! Exactly So, each edge block in text file has 2 sub blocks, geometry and ui. But, file has a lot of edge blocks. edge: 1 { type: 0 source: 1 target: 3 geometry: { values: } ui: { values } } edge: 2 { type: 0 source: 1 target: 3 geometry: { values: } ui...
  15. Hemulll

    Perl read block of file

    Hello Perl Gurus. I have a question about , how to read block of text file, for example i have a text file in next format: MR_ManagedObject true 2 LINK-PORT-10.112.32.73/1003<->PORT-10.112.32.81/8026 Switch 10.112.32.73 Switch 10.112.32.81 TrunkCable...

Part and Inventory Search

Back
Top