![]() |
| ||
| How to retrieve three columns using perl Hello, I have a file with the data as shown below: ATOM 2 CA ARG A 1 6.324 32.707 50.379 ATOM 13 CA THR A 2 5.197 32.618 46.826 ATOM 20 CA ASP A 3 4.020 36.132 46.259 ATOM 28 CA CYS A 4 7.131 38.210 45.919 I am a beginner in perl and i wrote a program to retrieve the last three columns and putting them in an array in order to calculate the distance open (IN, "out.pl"); my $file = ' '; while (<IN>) { chomp($file); my @array = /\d+\.\d+\s+\d+\.\d+\s+\d+\.\d+/ ..... am stuck. for(#calculate distance){ } } close (IN); I would like to know the script to match the three columns and putting them in an array and writng a for loop to calculate the distance between the four atoms given in the file. Thank you, |
| ||
| Re: How to retrieve three columns using perl open (IN, "filename.pdb") or die "$!"; Look into perls math operators for the distance calculations. The above just shows an example of how to get the last three columns from a line with 9 columns of varying length data seperated by spaces. |
| ||
| Re: How to retrieve three columns using perl Thank you so much.. that really helped me solve the problem |
| ||
| Re: How to retrieve three columns using perl |
| All times are GMT -4. The time now is 10:13 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC