[GRASS-user] do not export categories with v.out.ascii

Hamish hamish_nospam at yahoo.com
Wed Jul 25 22:47:28 EDT 2007


> Carlos wrote:
> > I was playing around with v.surf.nnbathy, and I tough it would be
> > nice if it could use a vector file as input. The problem is that
> > when exporting the vector as ascii to use as input for nnbathy, the
> > file has four columns (X,Y,Z,cat), and nnbathy wants a three-column
> > file. Can I get a XYZ from vector points without categories or
> > another step will be necessary to remove these values from the ascii
> > file?

Daniel Victoria wrote:
> Some awk magic might do the trick. Get the ASCII output and filter
> with the following
> 
> awk -F | '{print $1,$2,$3}'
> 
> This will print only columns 1, 2 and 3, as you might have
> suspected... the -F sets the column delimiter...

you need to quote the '|' so the shell doesn't treat it as a pipe.


another way is with cut and tr: (trade)

v.out.ascii map |  cut -f1-3 -d'|' |  tr '|' ','  > outfile.txt



Hamish




More information about the grass-user mailing list