Hi I know how to do do this when I have the full name of the files (usually I use rsync or a simple cp command) however I only have partial names.
Here is the simple script that I sometimes use for files in a list:
# Run pipeline
echo "Loading "
paste sample_id.txt |while IFS="$(printf '\t')" read -r sample;
do
cd $dirpath
cp -a source_directory/"$sample"*.fastq /output directory/;done
This seems to work fine when I have the complete file name but I'd like to be able to run this when I have a list containing partial file names.
For example I have directory that contains thousands of paired-end fastq files:
- ABF-0123-FGHKL_1.fastq
- ABF-0123-FGHKL_2.fastq
- ABG-0567-G456_1.fastq
- ABG-0567-G456_2.fastq
My sample id list contains:
- ABF-0123
- ABG-0567
The expected results:
- ABF-0123-FGHKL_1.fastq
- ABF-0123-FGHKL_2.fastq
- ABG-0567-G456_1.fastq
- ABG-0567-G456_2.fastq Thank you!