Hello, I run systems that collect measurement data and dump it into delimited text files. I'm trying to join these files and sort them by Date, Target_Name, and site so that i can plot the data. Currently, i have the following code that does work to join the files into a single file called All_CST.cst but I'm new to Perl and I'm having trouble with sorting. I know how to sort simple lists in Perl but re-ordering more complex data like I have in these logfiles is a bit beyond me at the moment (and I'd really like to avoid having to use MS Excel to do my sorting). I'd appreciate any help in pointing me in the right direction on sorting this type of data. Thanks in advance for your time.
My Script
#!/usr/bin/perl
open (LOGFILEOUT, "> ALL_CST.cst");
@files = <*.cst,*>;
$totallines=0;
foreach(@files){
if ($_ =~ /ALL_CST.cst/){next;};
$filename=$_;
open (LOGFILEIN, "< $filename");
while (<LOGFILEIN>){
print LOGFILEOUT "$_ \n";
}
}
The Data files are here:
My Script
#!/usr/bin/perl
open (LOGFILEOUT, "> ALL_CST.cst");
@files = <*.cst,*>;
$totallines=0;
foreach(@files){
if ($_ =~ /ALL_CST.cst/){next;};
$filename=$_;
open (LOGFILEIN, "< $filename");
while (<LOGFILEIN>){
print LOGFILEOUT "$_ \n";
}
}
The Data files are here: