this is a good way thanks a lot.
• 0 views
•
link
I have a folder containing 5000 fasta files, I want to extract the corresponding fasta files in txt according to a txt file, for example, 100989.fasta 84649.fasta 43985.fasta,is included in the list How do I extract and save to a new folder? I have used seqkit grep -n -f 2.list *.fasta > 2 code but no output result. Thanks a lot for your help
$ parallel --plus --dry-run cp {} newfolder/{} :::: list.txt
Remove dry-run if you are okay with dry run (dummy) execution. Always post data to address the issue. In this context, partial tree (folder contents) and content of text files would have helped addressing the issue better.
Just use while loop.
$ tree
.
├── 2/
├── 2.list
└── folder/
├── 100989.fasta
├── 43985.fasta
├── 84649.fasta
└── 9606.fasta
$ cat 2.list | while read f; do cp folder/$f 2/; done
$ tree
.
├── 2
│ ├── 100989.fasta
│ ├── 43985.fasta
│ └── 84649.fasta
├── 2.list
└── folder
├── 100989.fasta
├── 43985.fasta
├── 84649.fasta
└── 9606.fasta
this is a good way thanks a lot.
Log in to answer this question.