[GRASSLIST:2817] Re: XYZ Ascii into Grass

Nick Cahill ndcahill at facstaff.wisc.edu
Fri Dec 21 10:52:53 EST 2001

Another possible problem is that your ascii file may have Mac or DOS 
line breaks instead of UNIX line breaks. If you try to feed GRASS an 
ascii file with Mac line breaks it will fail. There are various ways 
to convert  -- I use BBEdit. Open the file in BBEdit; there's a 
pull-down menu at the top with a small page icon, and among the items 
are Macintosh, Unix, and Windows; choose Windows, then save the file. 
I think there's an applescript which will do the same thing. Then you 
can import the ascii text into a sites file as described by Andrea 
Aime. This works perfectly for me using just a file that has x y z 
coordinates separated by one or more spaces; I haven't needed a 
progressive integer number to import or interpolate. The grass module 
s.surf.rst then can interpolate the site file. I've done this 
successfully with GPS data (probably what you're doing too).

Good luck,

Nick Cahill
(another relative newbie on OSX)
Sardis Archaeological Expedition, Turkey

At 1:19 PM +0100 12/21/01, Andrea Aime wrote:
>Prepare a tab separated file with x y and z and try
>s.in.ascii sitefile in=asciifile sep=tab
>It this doesn't work, maybe you will need to add a
>progressive integer number to the ascii file, that is,
>x <tab> y <tab> prog <tab> z
>in order to import it properly and to use it with
>interpolation modules.
>Hope this helps, it's been some time since I imported
>ascii files into site format
>Best regards
>Andrea Aime
>Matthew Boulanger wrote:
>>  I'm the epitomy of a newbie to GRASS, I recently began using it once there
>>  was a version available for the Mac.  I have been using Surfer to do most of
>>  my work, and am looking at GRASS as a more suitable (and mac native)
>>  replacement.  My problem is that I can't for the life of me figure out how
>>  to import an ASCII text (either tab or comma delimited) file into GRASS and
>>  have it read the file as X,Y, and Z coordinates.  The closest I can come is
>>  to create a site file out of the X and Y points, and assign the Z to them.
>>  This isn't particularly helpful for me, as I am looking to create a terrain
>>  map with interpolated points between those I've plotted.  Any suggestions on
>>  how I can do this?
>>  Matthew Boulanger
>>  Czech-American Archaeological Field School


More information about the grass-user mailing list