|No such thing as a small change|
Joining separate data files to make one.by msexton (Initiate)
|on Oct 06, 2010 at 10:58 UTC||Need Help??|
msexton has asked for the
wisdom of the Perl Monks concerning the following question:
I would like to join data files that contain different attributes and produce one multicolumn file.
The individual files contain:
Date Time Latitude Longitude Attribute
The attributes are gravity (file 1), magnetics (file2) and bathymetry (file 3).
The final file would be:
Date Time Latitude Longitude Attribute1 Attribute2 Attribute3
I can join them if the individual files start at the same time and have the same length, but I have files that start and end at different times. If an attribute doesn't exist, I intend to enter a null value.
I am wondering if there is a construct that I should be looking at to perform this. I am currently importing each file into an array and then using the most confusing set of ifs and elsifs to cover each possibility.
I have toyed with cutting the input files into segments that are the same size and doing each in turn (ie. gravity and magnetics only, gravity and bathymetry only, bathymetry only). I thought I'd ask if there is another way.
Any suggestions greatly appreciated.