Please reply to the list.
is this one record of the file or is this an entire file?
be sure and read the docs for doing this kind of thing:
perldoc -f open
--
basically you want to do something like this. this is enought to get you
started. you won't learn anything if i write it for you. 

open(F, "<yourfile") or die "could not open: $!\n";
while (<FH>) {
        s/^\s+//;  # strip leading spaces
        $header = $_  if /HEADER/; # grab header line
        $auth = $_  if /AUTHOR/; #grap author line
        push (@atom, $_)  if /ATOM/; #push atom lines into an array
        ...
}

to further parse this and grab what you want like 'code', 'author name' ,
and the atom lines you want
perldoc -f split
perldoc -f substring
perldoc -f grep



> -----Original Message-----
> From: Baris Ozol [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 25, 2002 10:13 AM
> To: 'Kipp, James'
> Subject: RE: HElP ...me!
> 
> 
> 
> Thanks for reply.. I put a small example of the file .. I just want to
> find header and write as 
> 'this is an Oxygen Transport protein isolated at 08-DEC-97 
> and its code
> is 1A00'
>  
> And I want to get author name. AS the format I showed you.
>  
> And I want to get ATOM (1 by 1) like 'in the 3rd order Atom is C. it's
> located on VAL' and so on.
>  
>  
> HEADER    OXYGEN TRANSPORT                        08-DEC-97   1A00
> TITLE     HEMOGLOBIN (VAL BETA1 MET, TRP BETA37 TYR) MUTANT
> COMPND    MOL_ID: 1;
> EXPDTA    X-RAY DIFFRACTION
> AUTHOR    J.S.KAVANAUGH,A.ARNONE
> REVDAT   1   18-MAR-98 1A00    0
> JRNL        REF    TO BE PUBLISHED
> REMARK 900 1A0X, 1A0Y, 1A0Z, 1A01.
> DBREF  1A00 A    1   141  SWS    P01922   HBA_HUMAN        1    141
> SEQADV 1A00 MET B    1  SWS  P02023    VAL     1 ENGINEERED
> SEQRES   1 A  141  VAL LEU SER PRO ALA ASP LYS THR ASN VAL LYS ALA ALA
> SEQRES   2 A  141  TRP GLY LYS VAL GLY ALA HIS ALA GLY GLU TYR GLY ALA
> SEQRES   4 B  146  ARG PHE PHE GLU SER PHE GLY ASP LEU SER THR PRO ASP
> HELIX   32  32 LEU D   81  THR D   84  14    
> HELIX   33  33 ALA D   86  ASP D   94  19    
> HELIX   34  34 PRO D  100  GLU D  121  522    
> HELIX   35  35 PRO D  124  ALA D  142  119    
> LINK        FE   HEM A 142                 NE2 HIS A  87
> CRYST1   84.100  112.000   63.800  90.00  90.00  90.00 P 21 21 21    8
> ORIGX1      1.000000  0.000000  0.000000        0.00000
> ORIGX2      0.000000  1.000000  0.000000        0.00000
> ORIGX3      0.000000  0.000000  1.000000        0.00000
> SCALE1      0.011891  0.000000  0.000000        0.00000
> SCALE2      0.000000  0.008929  0.000000        0.00000
> SCALE3      0.000000  0.000000  0.015674        0.00000
> MTRIX1   1  0.950670 -0.050560  0.306050        5.59928    1
> MTRIX2   1 -0.051200 -0.998670 -0.005940       90.78605    1
> MTRIX3   1  0.305940 -0.010020 -0.952000      -20.34795    1
> ATOM      1  N   VAL A   1     101.601  38.534  -1.962  1.00 53.29 N  
> ATOM   4514  OXT HIS D 146      74.219  58.700  -6.876  1.00 18.18 O  
> TER    4515      HIS D 146 
> HETATM 4516 FE   HEM D 147      74.555  59.956  11.896  1.00 
> 17.05 FE  
> HETATM 4517  CHA HEM D 147      73.915  63.268  12.452  1.00 21.37 C  
> HETATM 4518  CHB HEM D 147      71.553  59.151  13.248  1.00 17.90 C
> HETATM 4774  O   HOH   473      72.622  28.948  11.969  1.00 24.04 O  
> CONECT  650  648  649 1071
> CONECT 1071  650 1076 1087 1095
> MASTER      217    0    4   35    0    0    0    9 4770    4  180   46
> END
> 
> -----Original Message-----
> From: Kipp, James [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, June 25, 2002 9:15 AM
> To: [EMAIL PROTECTED]
> Subject: RE: HElP ...me!
> 
> can you tell us how the data is file is formatted currently? also and
> code
> you have done so far. and what you want to do with it?
> 
> > -----Original Message-----
> > From: Baris Ozol [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, June 25, 2002 9:10 AM
> > To: [EMAIL PROTECTED]
> > Subject: HElP ...me!
> > 
> > 
> > Hi everybody,
> > 
> > Hopefully some of you will help to solve my problem!!
> > I'm trying to parse a flat file formatted file. It's a PDB 
> > (Protein Data
> > Bank).
> > 
> > But I didn't find any script on internet and perl.com. 
> > If you'll help me, I will be happy and solve the problem..
> > 
> > Thank you.
> > 
> > Bryce
> > 
> > 
> > 
> > -- 
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to