Test in small increments. For example to parse the SDF file, you could break out my code into a short test program like this:
As a note: If you are using Windows file names with a space in them, then the regex would be different. I only use filenames that are compatible with both Unix and Windows and that is probably the case here, but it may not be. One reason to run a simple test on the actual file!#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my %keepList; while (my $line = <DATA>) { my $sdf_file; next unless ($sdf_file) = $line =~ /(\w+\.nfo)/; $keepList{$sdf_file} = 1; print "keeping $sdf_file\n"; #update for debugging ####### } =example printout keeping filename1.nfo keeping filename2.nfo =cut __DATA__ fullpath="C:\directory\filename1.nfo" id="1a" fullpath="C:\directory\filename2.nfo"
update: I should clarify, when you have a choice, use only [a-zA-Z0-9_], in the file names, basically anything that meets the rules of a valid identifier in Perl or C is fine, what Perl calls \w characters. Forgo using spaces or dashes in the names if you can and your life will be easier.
In reply to Re^3: Compare 2 arrays
by Marshall
in thread Compare 2 arrays
by niceguy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |