4 usage="<simplefile input directory> <number of events> [<output directory> (optional, default is current)]"
6 if [[ "$1" == "-h" || "$1" == "-help" || "$1" == "--help" ]] ; then
11 if [ `file $1 | awk '{print $2}'` != "directory" ]; then
12 echo Error: $1 not a directory
19 *[!0-9+-]*|?*[-+]*|""|-|+)
20 echo Error: $2 not an integer
26 if [ ! $2 -ge 0 ] ; then
27 echo Error: $2 not a positive integer
38 if [ ! -z "$3" ] ; then
43 for (( i = 0 ; i < $2 ; i++ )); do
44 suffix=`EventStorageExtractor -storagetype simplefile -storagename $1 -eventnr $i -metadatadump | grep fDataType | grep fDataBlocks | awk '{print $4}' | sed s/\(// | tr A-Z a-z`
45 EventStorageExtractor -storagetype simplefile -storagename $1 -eventnr $i -datadump > $dir/event_$i.$suffix