Hi,
I need help please... :(
I created the following code to extract .vcf files from sub directories in a directory
time find /<location path>/ -name "*.vcf"\
| xargs cp -i --target-directory /<another location path and the directory I want to save the files in>
But now I want to modify this code to extract files which have the following format
aa_13.xxx.somenumber.yyyy.zzz.vcf
aabd_45.xxx.somenumber.yyyy.zzz.vcf
djf_65.xxx.somenumber.yyyy.zzz.vcf
fdsf_5349.xxx.somenumber.yyyy.zzz.vcf
...
From directories that contain 2 vcf files which have the same name but the xxx part.
e.g.
aa_13
directory has
aa_13.xxx.somenumber.yyyy.zzz.vcf
and aa_13.somenumber.yyyy.zzz.vcf
I want to get only the aa_13.xxx.somenumber.yyyy.zzz.vcf
into a separate directory.
I think there is a small edition which needs to be done, reading the xxx and yyy.zzz.vcf parts... But I just can't figure it out.
Can anyone please help, or guide me to the direction I need to go?
Thanks so much in advance
Hi,
This looks like an interesting problem to solve. Could you please clarify if the files are in the format:
Note that I added a
.vcf
to the end of the filenames. Am I correct in this assumption?Oops, Let me edit my question so it would be much clear.
They are in the below format,
etc..
Thanks for pointing that out.
and
*.vcf
doesn't work?Also, is your machine a Linux machine or a Mac?
Could you also give me some details on why you think it did not work (such as files were not copied etc). I think a
cp -iv
would give you a verbose summary of files being copied.Oh I see...I have completely misguided you... I'm sorry.
The problem is that one directory has two .vcf files.
E.g.
aa_13
directory hasWhat I want is to extract the one with the
xxx
in the middle of the file nameThank you