#!/perl

open(INFILE, "stuart_clemens_ibm.txt") || die "Could not open file";


@data;  #declare array for later use

while ( $line = <INFILE> ){

#get rid of all other lines
$a = "Group name";
$b = "Misc";
$c = "Comment";
$d = "These are the FOOBAR users";
$e = "Members";
$f = "-------------------------------------------------------------------------------";
$g = "The command completed successfully.";


# get rid of group name
$line =~ s/$a//;

# get rid of Comment
$line =~ s/$b//;

# get rid of Misc
$line =~ s/$c//;

# get rid of "These are the foobar users
$line =~ s/$d//;

# get rid of Members
$line =~ s/$e//;

# get rid of dashes
$line =~ s/$f//;

# get rid of command completed
$line =~ s/$g//;

# get rid of blank lines
#$line =~ s/^\n//;

# get the member names from each column
$col1 = substr($line, 0,24);
$col2 = substr($line, 25,24);
$col3 = substr($line, 50,24);

# push the names onto an array
push @data, $col1;
push @data, $col2;
push @data, $col3;


 }


# print the array
print @data;