This is he formart of the file with many more entries.
- E 100200 A Gizzi Avila aldo gonzalo
- E 1023877 A Arias Briones Claudio Andres
now i need to be able to capture from each line :
100200--> employee number
Action--> A
Last name--> Gizzi Avila (that's the tricky part)
First Name---> Aldo gonzalo (That's the tricky part)
now this is the code that i have
-
$UNIXFILE = "unixinfo.txt";
-
open(UNIXFILE) or die("Could not open UNIX FILE.");
-
foreach $line (<UNIXFILE>) {
-
-
($e,$id,$action,$first_name,$name)=split(/\s+/ ,$line);
-
-
#print" $e";
-
-
print"employee id: $id ";
-
-
print"Action: $action ";
-
-
print"First Name: $first_name ";
-
-
print"$name\n";
-
-
}
-
close(UNIXFILE);
NOtice that the last name and first name can have up to 3 diffren names and i need to capture that as on name.