Please tell me the correct script for xyz2grd

Hello everyone.

I am a GMT beginner.
I am attempting to convert xyz files to grd files using xyz2grd.
However, I am unable to convert them to grd files no matter how many times
I am running this script on GMT5.4.4 and windows10 command prompt.
Is there a mistake in my xyz2grd script?
Please, could you tell me how to convert it. is the file to be converted
GJODC.grd is the file that complements the marine area

#! /bin/csh

#set region = 132.500027778/132.749972222/34.500027778/34.666638882

set interval10 = 10e # grid interval in background data (e = meter)
set interval5 = 5e # grid interval in detailed data (e = meter)

set radius = 15e
set tension = 0.65
set inxyz5 =
set outxyz5 =
set blkfile2 = area2.blk
set grdfile = area.grd
set maskfile = area.mask.grd
set maskedfile = area_masked.grd
set backgrd = GJODC.grd
set backgrdsamp = altibathy_resamp.grd
set compgrdfile = file10.grd

awk ‘BEGIN {FS=“,”} {print $3,$2,$4}’ $inxyz5 > $outxyz5
set region = minmax $outxyz5 -I-1

blockmedian $outxyz5 $region -I$interval5 -V > $blkfile2
surface $blkfile2 $region -I$interval5 -T$tension -G$grdfile -V
grdmask $blkfile2 $region -I$interval5 -NNaN/1/1 -S$radius -G$maskfile -V
grdmath $grdfile $maskfile OR = $maskedfile
grdsample $backgrd -I$interval5 $region -G$backgrdsamp -V
grdmath $maskedfile $backgrdsamp AND = $compgrdfile

grdcontour -JM15 $compgrdfile $region -A500 -C100 -Ba10mf1mg10m -V -P -L0/10000 >

rm $blkfile1
rm $blkfile2
rm $grdfile
rm $maskfile
rm $maskedfile
rm $backgrd
rm $backgrdsamp

thank you

Where is your xyz2grd command? I don’t see any?

Also, you should give a simpler example with fewer commands. grdmask is not relevant for your problem.

GMT5.4 & Windows10 & Cshell? Really?

except this crucial point, the script in the topic seems not bad at all! A very good demonstration of how one could use surface, grdmask, grdmath and grdsample for gridding some local xyz data and combining it with another (global) gridded dataset.