source: gs3-installations/intermuse/trunk/sites/intermuse/collect/programmes/prepare/01-ARCHIVE-TO-ITEM.sh@ 36992

Last change on this file since 36992 was 36992, checked in by davidb, 18 months ago

Some basic scripts for turin IntermusE archive files into Greenstone .item files

  • Property svn:executable set to *
File size: 1.2 KB
Line 
1#!/bin/bash
2
3# HMS_1/HMS_1.pdf
4
5
6for archive_dir in HMS_*[0-9] ; do
7 echo "Processing $archive_dir"
8 vol=${archive_dir#*_}
9
10 item_dir=${archive_dir}_item
11
12 /bin/rm -rf $item_dir
13 mkdir $item_dir
14 #mkdir $item_dir/TIFFs
15 mkdir $item_dir/JPEGs
16
17 echo ""
18 echo "Generating $item_filename"
19 echo ""
20
21 item_filename=$item_dir/$archive_dir.item
22
23 echo "<Volume>$vol" > $item_filename
24
25
26 #images=$(cd $archive_dir/TIFFs && ls ${archive_dir}_[0-9][0-9][0-9][0-9].tif)
27 images=$(cd $archive_dir/JPEGs && ls ${archive_dir}_[0-9][0-9][0-9][0-9].jpg)
28
29 echo " Appending/Copying Images"
30 for image in $images ; do
31 page_num_with_ext=${image#_}
32 #page_num=${page_num_with_ext%.tif}
33 page_num=${page_num_with_ext%.jpg}
34
35 #echo " $archive_dir/TIFFs/$image -> $item_dir/TIFFs/$image"
36 #/bin/cp $archive_dir/TIFFs/$image $item_dir/TIFFs/$image
37 echo " $archive_dir/JPEGs/$image -> $item_dir/JPEGs/$image"
38 /bin/cp $archive_dir/JPEGs/$image $item_dir/JPEGs/$image
39
40 # Only image, no ocr'd txt file
41 #echo "$page_num:TIFFs/$image:" >> $item_filename
42 echo "$page_num:JPEGs/$image:" >> $item_filename
43 done
44
45
46
47done
48
49echo ""
50
51
Note: See TracBrowser for help on using the repository browser.