[sword-svn] r322 - trunk/modules/misc_cleanup

refdoc at crosswire.org refdoc at crosswire.org
Wed Apr 20 00:49:43 MST 2011


Author: refdoc
Date: 2011-04-20 00:49:43 -0700 (Wed, 20 Apr 2011)
New Revision: 322

Added:
   trunk/modules/misc_cleanup/order.pl
Log:
a short script to order USFM files along the canon


Added: trunk/modules/misc_cleanup/order.pl
===================================================================
--- trunk/modules/misc_cleanup/order.pl	                        (rev 0)
+++ trunk/modules/misc_cleanup/order.pl	2011-04-20 07:49:43 UTC (rev 322)
@@ -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


Property changes on: trunk/modules/misc_cleanup/order.pl
___________________________________________________________________
Added: svn:executable
   + *




More information about the sword-cvs mailing list