Hello,
I have files and directories that share a regex.
For every directory there are 2-4 files that share an id number.
Example:
Directory: 11355 Zfp71The files and directories exist in different different
files: 11355_SU, 11355_SD, 11355_pGk, 11355_LacZ
I humbly seek you wisdom.#!/usr/bin/perl use strict; use File::Copy; =for Create a hash to match the primer files with the maid folder. When a match occurs, copy it to the maid folder. Next create a new folder and populate it with the files to be processed by the sequence assembler. path to sequence files: "/Data/Sequencing_Results/RESULTS 2009/New Version 2009/Amanda Li"; =cut my %fields_hash; $lt_vec_seq = "/Data/Velocigene/Production Design/KOMP"; # Location of + the maid files $seq_results = "/Data/Velocigene/Production Design/KOMP/SequenceAssemb +lies"; # create hash consisting of maids as keys and sequence files as values sub seq_assembly{ # create a hash with maid folders as keys and the primer seq files as +values my %sequence_hash; $sequence_hash{$lt_vec_seq} = $seq_results; my @sorted_keys = sort { $a <=> $b || $b cmp $a } keys %sequence_h +ash; foreach my $key (@sorted_keys) { # Could use some direction concerning copying the $seq_results(whe +re files # exist) into $lt_vec_seq(directory) copy(); } }
In reply to Files and Directories that share a regex variable by lomSpace
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |