3 # Copyright 2005 David Hilvert <dhilvert@auricle.dyndns.org>,
4 # <dhilvert@ugcs.caltech.edu>
6 # This file is part of the Anti-Lamenessing Engine.
8 # The Anti-Lamenessing Engine is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or
11 # (at your option) any later version.
13 # The Anti-Lamenessing Engine is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with Anti-Lamenessing Engine; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 # Script to merge ALE cpf files. Assumes that the first columns of all files
24 # refer to points in the first frame in the sequence. These are written as the
25 # first column in the output, followed by the first file's columns, and then
26 # the second file's columns, etc.
34 @file_lines = `cat $_`;
37 $old_data_count = $data_count;
41 foreach (@file_lines) {
42 /^A (\d+ \d+) (.*)$/ or next;
47 if ($first_data_line) {
49 while ($data_copy =~ s/^\d+ \d+(.*)$/$1/) {
55 next if ($used_keys{$key});
57 if (!defined($points{$key})) {
58 $points{$key} = " nan nan" x
$old_data_count;
61 $points{$key} .= " $data";
65 foreach $key (keys %points) {
66 if (!defined($used_keys{$key})) {
67 $points{$key} .= " nan nan";
72 foreach $key (keys %points) {
73 print "A $key" . "$points{$key}\n";