#!/usr/bin/perl
#
# Compute quantities for the spring experiment
#
# MWR 10/27/2006

$debug = 1;

$infile = "./spring_expt.dat";
$outfile = "./spring_expt_extra.dat";

open(OUTFILE, ">$outfile") || die("can't open file $outfile");
open(INFILE, "$infile") || die("can't open file $infile");
while (<INFILE>) {
  $line = $_;
  chomp($line);
  if ($line =~ /^/) {
    print OUTFILE "%s\n", $line;
    next;
  }

  @words = split(/\s+/, $line);
  $t = $words[0];
  $force = $words[1];
  $x = $words[2];
  $v = $words[3];
  $a = $words[4];
  

}
close(INFILE);
close(OUTFILE);





exit 0;




##############################################################################
# PROCEDURE: exec_cmd
#
# DESCRIPTION: Execute the given shell command line.  If the $debug flag
#              is set, we print to stdout the command line, and
#              also print out the result string.
#
# RETURNS:
#              the result of the command
#
#
sub exec_cmd {

  my($cmd, $ret);

  $cmd = $_[0];

  if ($debug > 0) {
    printf "cmd is ..$cmd.. \n";
  }
  $ret = `$cmd`;
  if ($debug > 0) {
    printf "ret is ..$ret.. \n";
  }

  return($ret);
}


