#!/usr/bin/perl while (<>) { if (!/FILESGOHERE/) { print $_; } else { open FILELIST,'find Structures -type f | grep -v .arch-ids |'; while () { $md5sum = `md5sum $_`; chomp($md5sum); $md5sum = substr $md5sum, 0, 32; # $_ =~ s/\//\\\//g; chomp($_); print " \n"; } } }