#!/bin/sh
#  This shell is generated by ExplorDataShellTools / ExplorGenerShellIndexPath

echo "---- Executing sh /Users/jacquesducloy/Documents/WicriRoot/Wicri/Manuel/explor/Rabelais.storage/RabelaisV1/bin/MainExplorationIndexMesh.i.sh" 
export LC_ALL=C 

if test -e  $EXPLOR_AREA/Data/Main/Exploration/Mesh.i.hcs
then
echo "----- Executing -rf  $EXPLOR_AREA/Data/Main/Exploration/Mesh.i.*"
rm -rf  $EXPLOR_AREA/Data/Main/Exploration/Mesh.i.*
fi
HfdCat $EXPLOR_AREA/Data/Main/Exploration/biblio.hfd  \
     | SxmlSelect -s record/TEI/teiHeader/profileDesc/textClass/keywords@scheme=MESH@xml:lang=en/term/1 -p @s1 -p @1  \
     | sort -u  \
     | IndexFastBuildRec  \
     | HfdBuild -h $EXPLOR_AREA/Data/Main/Exploration/Mesh.i 

IndexBuildHid -h  $EXPLOR_AREA/Data/Main/Exploration/Mesh.i -p record/TEI/teiHeader/profileDesc/textClass/keywords@scheme=MESH@xml:lang=en/term/1 -e kw  

HfdCat $EXPLOR_AREA/Data/Main/Exploration/Mesh.i.hfd   \
     | SgmlFast -c l  \
     |  SxmlSelect -g idx/f/1 -p @g1 -p @2  \
     | sort -rn  \
     | SgmlFast -c 1  \
     | head -500 > $EXPLOR_AREA/Data/Main/Exploration/Mesh.i.sort  

 echo "==== " Main, step Exploration, index Mesh.i done
 HfdCat $EXPLOR_AREA/Data/Main/Exploration/Mesh.i.hfd | wc 
