#!/usr/bin/perl
if( $ARGV[0] eq '-h' || $ARGV[0] eq '-help')
{
help();
exit;
}
sub help {
  print "\nExtract the forces from a Gaussian output file.\n";
  print "Usage: gaussian_extract_frc  gaussian_out\n\n";
}


while(<>)
{
if (/Forces \(Hartrees\/Bohr\)/) {
$_=<>;$_=<>;
while(<>){
chomp;
($ind1, $ind2, $fx,$fy,$fz)=split;
if ($ind1 =~ /\d+/) {
print $fx."  ".$fy."   ".$fz."\n";
}else { exit; }
}
}
}


