Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: comparing an ID fom one file to the records in the second file

by jwkrahn (Abbot)
on Dec 01, 2017 at 19:00 UTC ( [id://1204676]=note: print w/replies, xml ) Need Help??


in reply to comparing an ID fom one file to the records in the second file

If you have the grep program installed then you could do:

grep -f BreastCnAPmiRNAsID.txt tarbaseData.txt > newfile.txt

Replies are listed 'Best First'.
Re^2: comparing an ID fom one file to the records in the second file
by ag88 (Novice) on Dec 02, 2017 at 11:41 UTC

    I tried this before posting the question. The newfile.txt is empty. Somehow the comparison is not done. :(

      You must be doing something wrong since it works fine for me:

      $ ls BreastCnAPmiRNAsID.txt tarbaseData.txt $ cat BreastCnAPmiRNAsID.txt hsa-miR-4700-5p hsa-miR-300 hsa-miR-381 hsa-miR-4803 $ cat tarbaseData.txt ENSG00000005175 RPAP3 hsa-miR-3199 Homo sapiens 293S Ki +dney NA HITS-CLIP POSITIVE DIRECT DOWN treatment:em +etine ENSG00000005175 RPAP3 hsa-miR-342-3p Homo sapiens HELA +Cervix Cancer/Malignant HITS-CLIP POSITIVE DIRECT DOWN + Hela cells were treated with control shRNA. ENSG00000005175 RPAP3 hsa-miR-381-3p Homo sapiens HS5 B +one Marrow Normal/Primary HITS-CLIP POSITIVE DIRECT DO +WN NA ENSG00000005187 ACSM3 hsa-miR-196a-5p Homo sapiens EF3DAGO +2 NA Normal/Primary PAR-CLIP POSITIVE DIRECT DOWN + NA $ grep -f BreastCnAPmiRNAsID.txt tarbaseData.txt > output.txt $ cat output.txt ENSG00000005175 RPAP3 hsa-miR-381-3p Homo sapiens HS5 B +one Marrow Normal/Primary HITS-CLIP POSITIVE DIRECT DO +WN NA $

        Actually my command never executes. It just stays in the executing mode and when i go to the destination folder the size of output.txt remains 0bytes. I always had to press ctrl + C to stop execution so that the cursor returns to the current directory.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-04-23 11:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found