blob: 441be365250e9fee9ba898d13f4bb1d7a0b24f27 [file] [log] [blame]
Akron54c52212022-03-07 18:56:21 +01001#!/usr/bin/env perl
2use strict;
3use warnings;
4
5our @ARGV;
6
7my $file = $ARGV[0];
8
9open(X, '<' . $file);
10open(RAW, '>' . $file . '.raw');
11open(SPLIT, '>' . $file . '.split');
Akron049e5262022-03-18 09:59:34 +010012open(EOS, '>' . $file . '.eos');
Akron54c52212022-03-07 18:56:21 +010013
14my $init;
15
16while(!eof(X)) {
17 local $_ = <X>;
18
19 if (/^# text = (.+?)$/) {
20 if ($init) {
21 print SPLIT "\n";
22 print RAW ' ';
23 };
24 print RAW $1;
Akron049e5262022-03-18 09:59:34 +010025 my $temp = $1;
26 $temp =~ s/[\s\n\t]+//g;
27 print EOS $temp, "\n";
Akron54c52212022-03-07 18:56:21 +010028 }
29 elsif (m/^\d+[\s\t]/) {
30 if (/^\d+[\s\t]+([^\t\s]+)[\t\s]/) {
31 print SPLIT $1,"\n";
32 $init = 1;
33 }
34 };
35};
36
37close(X);
38close(RAW);
Akron049e5262022-03-18 09:59:34 +010039close(EOS);
Akron54c52212022-03-07 18:56:21 +010040close(SPLIT);