2010/2/18 António Rocha <[email protected]>:
> If you put it like that it seems easy :). How are you parsing metadata to an
> XML file?

With brute-force shell scripting (yes, I would better lear Python and use an XML
parser):

RangeBeginningDate=`cat $HDFXML   | grep RangeBeginningDate  | cut
-d'>' -f2 | cut -d'<' -f1`
RangeBeginningTime=`cat $HDFXML   | grep RangeBeginningTime  | cut
-d'>' -f2 | cut -d'<' -f1`
RangeEndingTime=`cat $HDFXML      | grep RangeEndingTime     |cut
-d'>' -f2 | cut -d'<' -f1`
QAPercentCloudCover=`cat $HDFXML  | grep QAPercentCloudCover | cut
-d'>' -f2 | cut -d'<' -f1`
QAPercentMissingData=`cat $HDFXML | grep QAPercentMissingData | cut
-d'>' -f2 | cut -d'<' -f1`
DayNightFlag=`cat $HDFXML | grep  DayNightFlag | cut -d'>' -f2 | cut -d'<' -f1`
PGEVersion=`cat $HDFXML   | grep PGEVersion | cut -d'>' -f2 | cut -d'<' -f1`
PGEVersionComposed=`echo $PGEVersion | sed 's/\.//g'`
ObservationDate=`echo $RangeBeginningDate | sed 's/\-//g'`

METASTRING="Date:$RangeBeginningDate;BeginningTime:$RangeBeginningTime;EndingTime:$RangeEndingTime;DayNightFlag:$DayNightFlag;QAPercentCloudCover:$QAPercentCloudCover;QAPercentMissingData:$QAPercentMissingData;PGEVersion:$PGEVersion"
echo $METASTRING

r.support map history="$METASTRING"

Ciao
Markus
_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to