1
votes

I have a file1 (directory) with:

d1wb9a4.fasta.profile
d2fhza1.fasta.profile
d2w1va_.fasta.profile
d3mmha_.fasta.profile
e1qtn.1B.fasta.profile

and file 2 (directory) with:

d1io1a_.dssp
d1nrja_.dssp
d1t6aa_.dssp
d1xdna_.dssp
d2ebfx1.dssp
d2nuga2.dssp
d3agna_.dssp
d3pkza_.dssp
e1qtn.1B.dssp

and file 3 (TEXTFILE) with:

d1bgfa_.fasta.profile
d1bkra_.fasta.profile
d1bm8a_.fasta.profile
d1boua_.fasta.profile
d1boub_.fasta.profile
d1bx7a_.fasta.profile
d1bxya_.fasta.profile

I want to create a 4th file that takes all that is COMMON amongst these files using their ID's, so it just needs to consider the ID, stripping the extensions. the example output for this should be:

e1qtn.1B

Considered join?Jeff Holt
Are files 1 and 2 literally directories on a file system? Also, please post expected output.dan
What should the output look like? Are the underscores significant? In the sample data, the only name d1* in the first list is d1wb9a4 and no entry in file 3 matches that, so presumably you want an empty output? If not, show coherent input data that should generate a non-empty output.Jonathan Leffler
The current sample would yield no result, right? e1qtn is the only ID common in file1 and file2, but it's not present in file3.pmf
I have not considered join, because it wouldnt solve the problem, it needs to remove the extensions and the output should be just the common ID. underscores are significant. its basically just the extension .fasta.profile or .dssp being removed @JeffHoltFrancesca C