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

Hi.
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?

cheers

Carlos

--
+-----------------------------------------------------------+
              Carlos Henrique Grohmann - Guano
  Visiting Researcher at Kingston University London - UK
  Geologist M.Sc - Doctorate Student at IGc-USP - Brazil
Linux User #89721 - carlos dot grohmann at gmail dot com
+-----------------------------------------------------------+
_________________
"Good morning, doctors. I have taken the liberty of removing Windows
95 from my hard drive."
--The winning entry in a "What were HAL's first words" contest judged
by 2001: A SPACE ODYSSEY creator Arthur C. Clarke

Can't stop the signal.

Hi Carlos,

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...

Cheers
Daniel

On 7/25/07, Carlos Guâno Grohmann <carlos.grohmann@gmail.com> wrote:

Hi.
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?

cheers

Carlos

--
+-----------------------------------------------------------+
              Carlos Henrique Grohmann - Guano
  Visiting Researcher at Kingston University London - UK
  Geologist M.Sc - Doctorate Student at IGc-USP - Brazil
Linux User #89721 - carlos dot grohmann at gmail dot com
+-----------------------------------------------------------+
_________________
"Good morning, doctors. I have taken the liberty of removing Windows
95 from my hard drive."
--The winning entry in a "What were HAL's first words" contest judged
by 2001: A SPACE ODYSSEY creator Arthur C. Clarke

Can't stop the signal.

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

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