blob: 9dfd824b31b690664ba30514cf62330363f05576 [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');
12
13my $init;
14
15while(!eof(X)) {
16 local $_ = <X>;
17
18 if (/^# text = (.+?)$/) {
19 if ($init) {
20 print SPLIT "\n";
21 print RAW ' ';
22 };
23 print RAW $1;
24 }
25 elsif (m/^\d+[\s\t]/) {
26 if (/^\d+[\s\t]+([^\t\s]+)[\t\s]/) {
27 print SPLIT $1,"\n";
28 $init = 1;
29 }
30 };
31};
32
33close(X);
34close(RAW);
35close(SPLIT);