Bonjour,
Je dois parser un fichier qui se compose comme montré ci-dessous.
Je ne veux sélectionner que la ligne qui commence par I jusqu'à // et la ligne T.
Pour le moment je veux seulement afficher le texte commençant par H jusqu'à //.
J'ai écrit le code suivant mais sans succès.
Il me renvoie systématiquement 1 mais je ne comprends pas pourquoi.
Merci par avance.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 use strict; use warnings; my $nom=''; my $annotation =''; my $dna =''; my $record = ''; my $filename = 'ess.txt'; my $save_input_separator = $/; #Ouverture du fichier open(GBFILE, $filename) or die "Cannot open file $filename"; { $/="//\n"; $record = <GBFILE>; } $/ = $save_input_separator; $nom=($record=~ /(.*)\/\/\n/s); #print $record; print $nom; exit;
H ANDN920101
D alpha-CH chemical shifts (Andersen et al., 1992)
R LIT:1810048b PMID:1575719
A Andersen, N.H., Cao, B. and Chen, C.
T Peptide/protein structure analysis using the chemical shift index method:
upfield alpha-CH values reveal dynamic helices and aL sites
J Biochem. and Biophys. Res. Comm. 184, 1008-1014 (1992)
C BUNA790102 0.949
I A/L R/K N/M D/F C/P Q/S E/T G/W H/Y I/V
4.35 4.38 4.75 4.76 4.65 4.37 4.29 3.97 4.63 3.95
4.17 4.36 4.52 4.66 4.44 4.50 4.35 4.70 4.60 3.95
//
H ARGP820101
D Hydrophobicity index (Argos et al., 1982)
R LIT:0901079b PMID:7151796
A Argos, P., Rao, J.K.M. and Hargrave, P.A.
T Structural prediction of membrane-bound proteins
J Eur. J. Biochem. 128, 565-575 (1982)
C JOND750101 1.000 SIMZ760101 0.967 GOLD730101 0.936
TAKK010101 0.906 MEEJ810101 0.891 ROSM880104 0.872
CIDH920105 0.867 LEVM760106 0.865 CIDH920102 0.862
MEEJ800102 0.855 MEEJ810102 0.853 ZHOH040101 0.841
CIDH920103 0.827 PLIV810101 0.820 CIDH920104 0.819
LEVM760107 0.806 NOZY710101 0.800 GUYH850103 -0.808
PARJ860101 -0.835 WOLS870101 -0.838 BULH740101 -0.854
I A/L R/K N/M D/F C/P Q/S E/T G/W H/Y I/V
0.61 0.60 0.06 0.46 1.07 0. 0.47 0.07 0.61 2.22
1.53 1.15 1.18 2.02 1.95 0.05 0.05 2.65 1.88 1.32
//
Partager