Here's one take on this off the top of my head(I haven't tested it, but I
_think_ it will work).  The text you are looking for is bordered by a line
that starts with the word User after some spaces, and a line that has only
white space.  It seems like there should be a better way somewhere, but
until we know what that is...

####################

my @output = `myApp.exe`; #using backticks to get output
my @users = '';

foreach(@output){
   my $found = '';
   if($_ =~ /^\s*User/i){
      $found = 1;
   }elsif($_ =~ /^\s+$/){
      $found = 0;
   }
   if($found){
      my @temp = split /\s+/,$_;
      push @users,$temp[1];
   }
}

shift @users; #get rid of the word 'User'

print "These are my users:\n";
foreach(@users){
   print "   $_\n";
}

###################



-----Original Message-----
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: 5/6/02 10:04 PM
Subject: Taking data from the screen to a file

Hi, 

I'm just new to Perl and have no idea where to start with the task that
I have to complete.  Any help would be appreciated.

Currently when a particular .exe is run, the following is displayed in
the command window - 

License server on host "kronos".
Running since Monday 4/04/96 15:53:13.

LICENSES:
 Max-Users       Expires       Password [status]
    19           none          2aae4b60.b4ac4f0f.02 [Valid]

 Maximum active users allowed: 19
 Current active users: 6
 Available licenses: 13

ACTIVE users:
    User            Priority           Time-out in
    rdc                 2              59 minutes (at 10:44:20)
    chris               1              26 minutes (at 10:10:45)
    cheryl           none              23 minutes (at 10:07:27)

License Usage Statistics:
2 licenses revoked today 4/14/96.
0 license requests denied.
0 active users bumped by preferred user.

>From this i need to extract "just" the user names and place them into an
external file.  How do I go about this?

Thanks heaps
Melissa


------------------------------------------------------------------------
------
This message and any attachment is confidential and may be privileged or
otherwise protected from disclosure.  If you have received it by mistake
please let us know by reply and then delete it from your system; you
should not copy the message or disclose its contents to anyone.





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to