#!/usr/bin/perl -w # # extract scalar value from # Madymo Output # ############################################################################### # USER INPUT ############################################################################### $file = "UserOpt.peak"; # Output File $word = "Thorax_acc"; # String to be searched in output file $line = 2; # number of line after $word for extraction of value $n = 5; # number of column minus 1, that has to be extracted ############################################################################### open(IN,$file); $found = 0; while(){ if ($found == $line){ @output = split; last } if ($found > 0){ $found ++; } if ($_ =~ /$word/){ $found = 1; } } print ("$output[$n]\n"); close(IN);