#!/usr/bin/perl # #use strict; #use warnings; my %fdates = ( FBBv0 => "dicom_fbb_v0_date.csv", FBBv2 => "dicom_fbb_v2_date.csv", MRIv0 => "dicom_mri_v0_date.csv", MRIv2 => "dicom_mri_v2_date.csv", ); my $fdpath = '/home/osotolongo/facehbi/'; my %imgdates; foreach my $fdate (sort keys %fdates){ $real_file = $fdpath.$fdates{$fdate}; open IDF, "<$real_file" or die "No such file"; while(){ (my $subject, my $imdate) = /(.*);(.*)/; $imgdates{$subject}{$fdate} = $imdate; } close IDF; } print "Subject"; foreach my $fdate (sort keys %fdates){ print ", $fdate"; } print "\n"; foreach my $subject (sort keys %imgdates){ print "$subject"; foreach my $fdate (sort keys %fdates){ if (exists($imgdates{$subject}{$fdate})){ print ", $imgdates{$subject}{$fdate}"; }else{ print ", -"; } } print "\n"; }