[GRASSLIST:7994] ascii vector line format question

Dear All,

Is it a 100% rule, that the line ending is *always* indicated by "1"?

Say like here:

L 12 1
597230.44979275 5681618.56747334
597235.81795873 5681608.14691583
597241.81767366 5681596.14748598
1 2

I have written a simple awk script for exporting Grass vector into a Surfer "blanking file", "BLN" ascii format, which is e.g. used for defining elevation faults for interpolation in Surfer. I would like to share it on a WIKI, but first I need to make sure if the awk search formula I use:

( (NR > 10) && ($1 == "L") ) {print $2",0"}
( (NR > 10) && ($1 != "L") && ($1 !=1) ) {print $1","$2}

is 100% compatible with any possible Grass ascii line vector file.

Maciek

On 8/19/05, Maciek Sieczka <werchowyna@epf.pl> wrote:

Dear All,

Is it a 100% rule, that the line ending is *always* indicated by "1"?

Say like here:

L 12 1
597230.44979275 5681618.56747334
597235.81795873 5681608.14691583
597241.81767366 5681596.14748598
1 2

I have written a simple awk script for exporting Grass vector into a Surfer
"blanking file", "BLN" ascii format, which is e.g. used for defining
elevation faults for interpolation in Surfer. I would like to share it on a
WIKI, but first I need to make sure if the awk search formula I use:

( (NR > 10) && ($1 == "L") ) {print $2",0"}
( (NR > 10) && ($1 != "L") && ($1 !=1) ) {print $1","$2}

is 100% compatible with any possible Grass ascii line vector file.

Maciek

No, it depends on number of layers and categories specified as second
number after L, here are some examples:
L 2 0
597230.44979275 5681618.56747334
597235.81795873 5681608.14691583
L 2
597230.44979275 5681618.56747334
597235.81795873 5681608.14691583
L 2 1
597230.44979275 5681618.56747334
597235.81795873 5681608.14691583
1 2
L 2 2
597230.44979275 5681618.56747334
597235.81795873 5681608.14691583
1 2
1 3
L 2 3
597230.44979275 5681618.56747334
597235.81795873 5681608.14691583
1 2
1 3
2 123

Radim

From: "Radim Blazek" <radim.blazek@gmail.com>

On 8/19/05, Maciek Sieczka <werchowyna@epf.pl> wrote:

Dear All,

Is it a 100% rule, that the line ending is *always* indicated by "1"?

Say like here:

L 12 1
597230.44979275 5681618.56747334
597235.81795873 5681608.14691583
597241.81767366 5681596.14748598
1 2

I have written a simple awk script for exporting Grass vector into a
Surfer
"blanking file", "BLN" ascii format, which is e.g. used for defining
elevation faults for interpolation in Surfer. I would like to share it on
a
WIKI, but first I need to make sure if the awk search formula I use:

( (NR > 10) && ($1 == "L") ) {print $2",0"}
( (NR > 10) && ($1 != "L") && ($1 !=1) ) {print $1","$2}

is 100% compatible with any possible Grass ascii line vector file.

Maciek

No, it depends on number of layers and categories specified as second
number after L, here are some examples:
L 2 0
597230.44979275 5681618.56747334
597235.81795873 5681608.14691583
L 2
597230.44979275 5681618.56747334
597235.81795873 5681608.14691583
L 2 1
597230.44979275 5681618.56747334
597235.81795873 5681608.14691583
1 2
L 2 2
597230.44979275 5681618.56747334
597235.81795873 5681608.14691583
1 2
1 3
L 2 3
597230.44979275 5681618.56747334
597235.81795873 5681608.14691583
1 2
1 3
2 123

Radim,

Thanks for clearing this out to me. Bad thing I don't know how to cope with many layers. I hope some awk Whizz can suggest right approach. As for now I'm at
least happy my first awk script can handle one layer line vector :), but that might be usefull only for me :frowning: .

Maciek