in reply to How to append record at the existing record ?
open(fd1,"log.txt") or die"unable to open"; open(fd2,">>log2.txt"); while($getVal=<fd1>) { if($getVal=~/name/) { $getVal="Designation :Manager\n".$getVal; } print fd2 $getVal; } close(fd1); close(fd2);
Edited by planetscape - added code tags
|
|---|