The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 09-01-2008
summer_cherry summer_cherry is offline Forum Advisor  
Registered User
  
 

Join Date: Jun 2007
Location: Beijing China
Posts: 1,088
Code:
open(FH,"<filename");
while(<FH>){
	@arr=split(/\\n/,$_);
        for($i=0;$i<$#arr;$i++){
		($id, $id2, $name, $date, $email)=split(/\|/,$arr[$i]);
		printf("Name:%s,ID1:%s,ID2:%s,Email:%s\n",$name,$id,$id2,$email);
	}
}
close(FH);