#!/bin/sh
 
if test $# != 2
then
   echo Extract XA plane from 4D hypercomplex FID:
   echo " Usage:   " $0 inTemplate outName
   echo " Example: " $0 fid/test%02d%03d.fid xa.fid
   exit 1
fi

inName=$(echo $1|sed -e '/%02d/s/%02d/%02.0f/g'|sed -e '/%03d/s/%03d/%03.0f/g')
outName=$2

M $NMRTXT/xa.M -str inName $inName outName $outName -quit
