Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: match two files

by tybalt89 (Monsignor)
on Dec 09, 2020 at 11:31 UTC ( [id://11124874]=note: print w/replies, xml ) Need Help??


in reply to match two files

#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11124864 use warnings; use Path::Tiny; my %two = map /^(\d+)(.*)/, path('tmp02')->lines; my $out = "PeptideID ProteinID SpectrumID Sequence\n"; s/^(\d+)(.*)/$1$2$two{$1}/ and $out .= $_ for path('tmp01')->lines; path('tmp11_quick')->spew($out);

Replies are listed 'Best First'.
Re^2: match two files
by yueli711 (Sexton) on Dec 09, 2020 at 16:45 UTC

    Hello tybalt89, Thank yo so much for your great help! It works, but still has a problem. Thank you again and really appreciated! Best, Yue

    Use of uninitialized value in concatenation (.) or string at match_qui +ck03.pl line 9.

      Please give a (small) dataset that shows that problem.

        Hello tybalt89, Thank you so much for your great help! The code is correct! A small question: How can 6 and 109521 separated with "Tab"? It looks they are separated with space. Thank you again and really appreciated! Best, Yue
        PeptideID ProteinID SpectrumID Sequence 6 109521 53663 KMGEGR 7 741 53663 KPPSGK 11 681 144492 NNDALR 11 780 144492 NNDALR 20 2352 15547 SPAKPK 27 1490 55547 LHKPPK 27 1491 55547 LHKPPK 27 1492 55547 LHKPPK 28 51996 55547 LFVGRK 29 1490 55504 LHKPPK 29 1491 55504 LHKPPK 29 1492 55504 LHKPPK 30 1490 55602 LHKPPK 30 1491 55602 LHKPPK 30 1492 55602 LHKPPK

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-04-19 16:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found