Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re^4: reading and working with grow.out files

by rmgzsm9 (Novice)
on Apr 29, 2012 at 13:12 UTC ( #967932=note: print w/replies, xml ) Need Help??

in reply to Re^3: reading and working with grow.out files
in thread reading and working with grow.out files

Can I ask you for little more help? The program helped me so much. Thanks for that. Now I need to modify it a bit more. I tried myself but got stuck at one point. Can u help me out?

so now I don't want to print the line containing ligand name , rather now i want to count no of lines and want to count amongst those lines, the lines containing H as a 1st character of each row. I successfully counted the lines by using following code

# changed the code from line 10 of above written code while (my $line= <FILE> { $ count=0; if $line=~/$ligand/; { $count++;} } Print"total no of interaction are $count"; }close (FILE); }

this counts only no of lines. Now, I want while the program is reading code line by line it should check the first character and if it is H the it should count that line and put the count in another variable say count2 or something.

 Please help 

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://967932]
and the monastery is silent...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2018-03-19 19:40 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (246 votes). Check out past polls.