Thread x-werte in x-dateien schreiben (10 answers)
Opened by Rambo at 2005-03-01 13:07

Rambo
 2005-03-02 13:30
#52208 #52208
User since
2003-08-14
803 Artikel
BenutzerIn

user image
hallo noch mal,
ich habe mein script fast fertig bis auf zwei kleine dinge für
die ich noch mal eure hilfe benötige
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
use strict;
use warnings;
use LWP::Simple;

print "\n\nEnter String for Production or Test System URL
(e.g PU for Production or TEST Test System):\n";
chomp (my $input = <STDIN>);
$input = uc $input;
my $srv_url= 'http://Usr:pwd@my-home-page';
if ($input eq "TEST")
  {
   $srv_url = 'http://Usr2:pwd2@my-home-page';
  }

my $srv_file = "srv_site.html";
my $content = getstore($srv_url,$srv_file);

open(SRV_HTML,"<$srv_file") or die $!;
while (my $strings = <SRV_HTML>)
{
  if ($strings =~ /href.*workstationid\&value\=([^"]+)".*href.*ipc2\&value\=([0-9\.\:]+)"/i)
  {
     my ($w,$i) = ($1,$2);
     my $srv_list = "http://Usr:pwd@my-home-page=$i";
     &md_files($w,$i,$srv_list);            
  }
}
close SRV_HTML;

sub md_files
  {
  my ($w,$i,$srv_list) = @_;
      my @w1 = $w;
      for my $w1(@w1)
         {
          my $w1 = './home/'.$w1.'.txt';
          open(my $fh, ">$w1") or die $!;
          for ($srv_list)
             {
               my $content = get($srv_list);
               print $fh $content,"\n";
               close $fh;
               &con_cli($fh,$content,$w1,$w);  
             }
         }
   }

sub con_cli
  {
   my ($fh,$content,$w1,$w) = @_;
   my @w2 = $w1;
   my $cli_str;
   for my $cli(@w2)
      {
       open(CLI_HTML,"<$cli") or die $!;
       while ($cli_str = <CLI_HTML>)
            {
             if($cli_str =~ s/<tr><td>CLIENTS=(.+)<\/td><\/tr>/$1/){
             my @cli_str = split '&nbsp;', $cli_str;
             for $cli(@cli_str)
                {
                 my @wks = split 'pixxadm', $cli;
                 print "$w => @wks\n";
                }
             }
         }
      }  
   }
close CLI_HTML;

dies erzeugt folgende ausgabe
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
W2K-FRAPIC-AP03_3081 =>         RESA_BRU_BRU1GTA59M
W2K-FRAPIC-AP03_3081 => RESA_BRU_BRU2CK0206
W2K-FRAPIC-AP03_3081 => RESA_BRU_BRU1GTA59M
W2K-FRAPIC-AP03_3081 => SITA_DTM_DTM1CKB029
W2K-FRAPIC-AP03_3081 => ARINC_BHX_BHXCK045
W2K-FRAPIC-AP03_3081 => RESA_BRU_BRU1CK0205
W2K-FRAPIC-AP03_3081 =>
W2K-FRAPIC-AP03_3081 =>
W2K-FRAPIC-AP03_3081 => SITA_PAD_PAD1CKB012
W2K-FRAPIC-AP03_3081 => ARINC_BHX_BHXCK051
W2K-FRAPIC-AP03_3081 => SITA_LAX_LAXBCKB009
W2K-FRAPIC-AP03_3081 => SITA_LAX_LAXBCKB017
W2K-FRAPIC-AP03_3081 => SITA_DTM_DTM1CKB027
W2K-FRAPIC-AP03_3081 => RESA_FRA_WNTCUTELAB1
W2K-FRAPIC-AP03_3081 => RESA_FRA_WNTCUTELAB1
W2K-FRAPIC-AP03_3081 => SITA_LEJ_LEJ1CKB005
W2K-FRAPIC-AP03_3081 => SITA_FRA_FRAB2BLH26
W2K-FRAPIC-AP03_3081 => RESA_BRU_BRU1GTA69M
W2K-FRAPIC-AP03_3081 => ARINC_BHX_BHXGT63A
W2K-FRAPIC-AP03_3081 => RESA_BRU_BRU2CK0204
W2K-FRAPIC-AP03_3081 =>

W2K-FRAPIC-AP01_3083 =>         SITA_EWR_EWRBCKB031
W2K-FRAPIC-AP01_3083 =>
W2K-FRAPIC-AP01_3083 =>
W2K-FRAPIC-AP01_3083 =>
W2K-FRAPIC-AP01_3083 =>
W2K-FRAPIC-AP01_3083 =>
W2K-FRAPIC-AP01_3083 =>
W2K-FRAPIC-AP01_3083 =>
W2K-FRAPIC-AP01_3083 =>
W2K-FRAPIC-AP01_3083 =>
W2K-FRAPIC-AP01_3083 => RESA_BRU_BRU2CK0202
W2K-FRAPIC-AP01_3083 => ARINC_BHX_BHXCK050
W2K-FRAPIC-AP01_3083 => RESA_BRU_BRU2CK0208
W2K-FRAPIC-AP01_3083 => SITA_DTM_DTM1BOOEW1
W2K-FRAPIC-AP01_3083 => RESA_BRU_BRU2GTA60M
W2K-FRAPIC-AP01_3083 => ARINC_BHX_BHXGT63A
W2K-FRAPIC-AP01_3083 => SITA_PAD_PAD1CKB010
W2K-FRAPIC-AP01_3083 =>

W2K-FRAPIC-AP01_3081 =>
W2K-FRAPIC-AP01_3081 =>

was ich jetzt noch benötige ist ein zähler für jeden dieser server / clients das die leeren teile verschwinden und das die
die strings eingereit sind:
Code: (dl )
1
2
3
4
5
6
7
8
1. W2K-FRAPIC-AP03_3081 => RESA_BRU_BRU1GTA59M
2. W2K-FRAPIC-AP03_3081 => RESA_BRU_BRU2CK0206
3. W2K-FRAPIC-AP03_3081 => RESA_BRU_BRU1GTA59M
4. W2K-FRAPIC-AP03_3081 => SITA_DTM_DTM1CKB029
5. W2K-FRAPIC-AP03_3081 => ARINC_BHX_BHXCK045
6. W2K-FRAPIC-AP03_3081 => RESA_BRU_BRU1CK0205
7. W2K-FRAPIC-AP03_3081 => SITA_PAD_PAD1CKB012
usw

könnet ihr mir hier ein tipp geben?

merci
rambo

View full thread x-werte in x-dateien schreiben