aboutsummaryrefslogtreecommitdiff
path: root/scripts/indexed-filenames
blob: 842d264db2e9229dd10bcb1f8eed0b24fdf66eab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/perl -w

use strict;

open(FH, $ARGV[0]);

my $line;
my $is_indexed;
my $filename;

while ( $line = <FH> ) {

	if ( $line =~ /^-----\ Begin chunk\ -----$/ ) {
		$is_indexed = 0;
	}

	if ( $line =~ /^Image\ filename: (.*)$/ ) {
		$filename = $1;
	}

	if ( $line =~ /^Cell\ parameters/ ) {
		$is_indexed = 1;
	}

	if ( $line =~ /^-----\ End chunk\ -----$/ ) {
		if ( $is_indexed ) {
			printf("%s\n", $filename);
		}
	}


}