#!/usr/bin/perl

system "cut -f6 YL_data_request_20nov2025.txt | grep ddn > list";
system "cut -f7 YL_data_request_20nov2025.txt | grep ddn >> list";

unless (-d "data") { system "mkdir data"; }

open(IN, "list");
while (<IN>) {
  chomp $_; $fq = $_;
  unless (-e $fq) { print "ERROR: Did not find $fq; skipping this one.\n"; next; }
  @ar = split/\//, $fq; $fqShort = $ar[$#ar];
  next if (-e "data/$fqShort");
  print "cp $fq data/$fqShort &\n";
}
close(IN);

system "rm list";
