create_lookup_grp.sh 469 B

123456789101112131415161718192021222324252627282930
  1. # input params
  2. # source ./config.txt
  3. source $1
  4. num_files=0
  5. begin=0
  6. end=0
  7. echo "Start End Name" > "$LOOKUP_FILE"
  8. for file in "$SPLIT_BASE_DIR"/*.csv # list files
  9. do
  10. num=`awk 'NR==1{print $1}' $file`
  11. begin=$((num_files+1))
  12. end=$(( $num_files + $num ))
  13. base=`basename "$file"`
  14. row="$begin $end ${base%.*}"
  15. echo "$row" >> $LOOKUP_FILE
  16. num_files=$(( $num_files + $num ))
  17. done
  18. echo "$end" > "$NUM_HDF5_DS"