From a7d0bd22660fbb1ce744f0678d9311519ce48362 Mon Sep 17 00:00:00 2001 From: Peter von Kaehne Date: Wed, 20 Apr 2011 07:49:43 +0000 Subject: 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 --- modules/misc_cleanup/order.pl | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 modules/misc_cleanup/order.pl (limited to 'modules/misc_cleanup') 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 -- cgit