Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: correlation between two inputt files

by aaron_baugher (Deacon)
on Apr 27, 2012 at 15:17 UTC ( #967666=note: print w/ replies, xml ) Need Help??


in reply to Re^2: correlation between two inputt files
in thread correlation between two inputt files

Feel free to contact me to arrange payment...

#!/usr/bin/env perl use Modern::Perl; my @p; open my $fd2, '<', 'INPUT_FILE2.TXT' or die $!; while(<$fd2>){ next if /#/ or ! /\w/; my( $p, $n ) = split; push @{$p[$n]}, $p; } close $fd2; open my $fd1, '<', 'INPUT_FILE1.TXT' or die $!; while(<$fd1>){ next if /#/ or ! /\w/; my( $r, $n ) = split; say "reactant: $r, product: $_" for @{$p[$n]}; } close $fd1;

Aaron B.
My Woefully Neglected Blog, where I occasionally mention Perl.


Comment on Re^3: correlation between two inputt files
Download Code
Re^4: correlation between two inputt files
by himanshuyadav on Apr 27, 2012 at 16:02 UTC
    dear sir, great thanks on your reply.I am a B.Sc 1st year student in India.This script is needed for our Biochemistry project. It is giving slightly different result.It will be great if you can look into it and modify it according to desired output. waiting for your reply. Thank you.
      Right after you send me (privately, so I can make a ton of $$$ off it) a cure for cancer.

      That should be right up a BioChem major's alley.

      Alternately, send me a contract assigning to me all your future patents, proceeds of royalty agreements, and salary.

      Since you don't say what you want different about the results, I couldn't modify it if I wanted to. In your sample, you show it outputting the reactants in the order E, C, A, B, and since that doesn't match the order from the file or alphabetical order, I have no idea what you're shooting for there.

      I already did 99% of the work on spec. If you're trying to learn Perl, figuring out the last 1% will be good practice. If you're not interested in learning Perl, and just need a script written for your classroom, then again, I (and others here, I'm sure) will be glad to offer you a quote for the work.

      Aaron B.
      My Woefully Neglected Blog, where I occasionally mention Perl.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://967666]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (14)
As of 2014-09-01 13:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (13 votes), past polls