open (FILE, $ARGV[0]) or die("Error:'\n"); open(OUTPUT,">output.txt"); my $line; while ($line = ) { chomp($line); @array = split(" ", $line); for($array[0]=object-group) { print OUTPUT "set shared address-group $array[2]\n"; } } close (FILE); exit;