summaryrefslogtreecommitdiffstats
path: root/modules/misc_cleanup
diff options
context:
space:
mode:
authorPeter von Kaehne <refdoc@gmx.net>2011-04-20 07:49:43 +0000
committerPeter von Kaehne <refdoc@gmx.net>2011-04-20 07:49:43 +0000
commita7d0bd22660fbb1ce744f0678d9311519ce48362 (patch)
treef5efefad8ad506ff454d4604de70500cd887c845 /modules/misc_cleanup
parent8829e802e6dc5c77d1b32d253365ea628a5ac5a1 (diff)
downloadsword-tools-a7d0bd22660fbb1ce744f0678d9311519ce48362.tar.gz
a short script to order USFM files along the canon
git-svn-id: https://www.crosswire.org/svn/sword-tools/trunk@322 07627401-56e2-0310-80f4-f8cd0041bdcd
Diffstat (limited to 'modules/misc_cleanup')
-rwxr-xr-xmodules/misc_cleanup/order.pl29
1 files changed, 29 insertions, 0 deletions
diff --git a/modules/misc_cleanup/order.pl b/modules/misc_cleanup/order.pl
new file mode 100755
index 0000000..a650724
--- /dev/null
+++ b/modules/misc_cleanup/order.pl
@@ -0,0 +1,29 @@
+#!/usr/bin/perl
+# This script will order an unsorted directory of usfm files by adding a number to the name of each file, in
+# order of the books of the Bible. You need to edit the script to prepare for different versififcations/caanons,
+# You also need to edit line 22 for your particular file naming scheme
+
+use strict;
+use warnings;
+use File::Copy;
+
+my @books = ( 'GEN','EXO','LEV','NUM','DEU','JOS','JDG','RUT','1SA','2SA','1KI','2KI',
+ '1CH','2CH','EZR','NEH','EST','JOB','PSA','PRO','ECC','SNG','ISA','JER',
+ 'LAM','EZK','DAN','HOS','JOL','AMO','OBA','JON','MIC','NAM','HAB','ZEP',
+ 'HAG','ZEC','MAL','MAT','MRK','LUK','JHN','ACT','ROM','1CO','2CO','GAL',
+ 'EPH','PHP','COL','1TH','2TH','1TI','2TI','TIT','PHM','HEB','JAS','1PE',
+ '2PE','1JN','2JN','3JN','JUD','REV');
+$/="\n";
+my $i = 1;
+
+foreach (@books) {
+ if ($i==40) {$i=41}
+ if ($i<10) {$i="0".$i}
+ my $old = $_.'.Nav.sfm';
+ my $new = 'result/'.$i.$old;
+
+ copy($old,$new);
+ $i++;
+ $i=int($i);
+ }
+ \ No newline at end of file