Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:45:30

0001 #!/usr/bin/env bash
0002 # Combines several files produced by groupFilesInBlocks.py into one
0003 # Usage:
0004 # ./combineBlockFiles.sh output.py input1.py input2.py ...
0005 
0006 n=-1
0007 touch tmpasdf_1
0008 rm tmpasdf_*
0009 for fn in $*
0010 do
0011  eval n=$(($n+1))
0012  if [ $n == 0 ]; then continue; fi
0013  sed -e "s/fileNamesBlocks/fileNamesBlocks_${n}/g" $fn > tmpasdf_${n}
0014 done
0015 
0016 echo "writing to" $1
0017 
0018 echo "" > $1 
0019 for fn in tmpasdf_*
0020 do 
0021   cat $fn >> $1
0022   echo "" >> $1
0023 done
0024 rm tmpasdf_*
0025 
0026 echo "" >> $1
0027 echo "fileNamesBlocks = []" >> $1
0028 for i in `seq $n`
0029 do
0030   echo "fileNamesBlocks.extend(fileNamesBlocks_${i})" >> $1
0031 done
0032 
0033 echo "print 'number of file blocks = ', len(fileNamesBlocks)" >> $1
0034