This Perl script does the first part reading the filenames and headers into an array using File::Find. How is the order of the lines in Header.txt matched to these filenames/headers ?
poj#!/usr/bin/perl use strict; use File::Find; use Data::Dumper; my $folder = '/folder/with/fasta/files'; my @files=(); find( \&process, $folder ); print Dumper \@files; sub process { return unless $_ =~ /CDS\.fasta$/; my $file = $File::Find::name; open my $fh,'<',$file or die $!; my $header = <$fh>; close $fh; push @files,[$File::Find::dir,$_,$header]; }
In reply to Re^3: Command or Perl script for changing headers of multiple FASTA files in a specific order listed in a txt file
by poj
in thread Command or Perl script for changing headers of multiple FASTA files in a specific order listed in a txt file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |