#!/usr/bin/perl # c13no_unfold # # # syntax: dimer_peak_reset input_file > output_file # loop through input_file line by line while (<>){ # split line into fields, store in array of $fld variables @fld = split; #delimits by whitespace #print "$fld[10] $fld[11] \n"; # identify and print header lines without change if(/#/){ print "$_"; next; } # select peaks based on combination of 13C and 1H shift if($fld[10] > 593 && $fld[11] < 565){ #print "$fld[10] $fld[11] \n"; $atom_number = $fld[11] - $fld[11]; #print "$atom_number\n"; } elsif($fld[10] < 565 && $fld[11] > 593){ #print "$fld[10] $fld[11] \n"; $atom_number = $fld[11] - $fld[11]; #print "$atom_number\n"; } else{ $atom_number = $fld[11]; #print "$atom_number\n"; } # write out each peak with correct 13C shift $~ = "PEAKS"; write; } #define format for output format PEAKS = @>>> @##.### @##.### @##.### @ @ @>>>>>>>>> @>>>>>>> @ @ @>>> @>>> @>>> 0 $fld[0], $fld[1], $fld[2], $fld[3], $fld[4], $fld[5], $fld[6], $fld[7], $fld[8], $fld[9], $fld[10], $atom_number, $fld[12] .