aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-08-15 14:41:07 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:36 +0100
commit9695eab2909252a352e521d354d0c6c70de27210 (patch)
treeadf956c62bf5b0b5a4b9141462fb885f9e54a822 /scripts
parent22af0f09eb410c397d0fee3af72710765efb2f3b (diff)
Add scripts/indexed-filenames
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/indexed-filenames32
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/indexed-filenames b/scripts/indexed-filenames
new file mode 100755
index 00000000..842d264d
--- /dev/null
+++ b/scripts/indexed-filenames
@@ -0,0 +1,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);
+ }
+ }
+
+
+}