HELP with converting a labels file to a sites file

To you programmer types out there on the net:

I am trying to convert quite a few GRASS labels files to sites files for use
in various MAPGEN applications here at Ft Sill. While it is possible to drag
and drop the easting, northing and text from the labels file to a new sites
file, I find that it is very time consuming and prone to error if I don't
watch what's going on.

As I have yet to master the awk command structure, a routine I have been told
will work, I am asking the net for assistance in preparing the script/routine.
The only other thing, which would be better, is if there is an existing script
that does this conversion already.

Any help I can get will be appreciated. I can be reached directly at
garvinc@sill-emh.army.mil or by phone at (405) 442-3314/6174.

Chris D Garvin

Here is an l2sites awk program for you.

#! /usr/bin/awk -f

{
if ($1 == "east:") {printf("%s|", $2)}
if ($1 == "north:") {printf("%s|", $2)}
if ($1 == "text:") {printf("%s\n", $2)}
}

You may need to edit the first line to get your awk path correct.
Then save to a file and invoke as:

l2sites labels_file > sites_file.

Since this script did not include any GRASS or environment variables
you will need to give the paths to you labels and sites files.

-Sue Huse
REGIS
UC Berkeley