[GRASS-user] A better way to create color table out of
"GLC_EU_V2.clr" for r.colors
Nikos Alexandris
nikos.alexandris at felis.uni-freiburg.de
Tue Mar 18 11:12:58 EDT 2008
On Tue, 2008-03-18 at 12:24 +0100, Nikos Alexandris wrote:
[...]
> >
> > sure, r.colors can read the original without need to convert "R G B"
> > to "R:G:B" or remove any extra spaces.
> ! I think I tried that... I am re-checking.
It doesn't work for me.
r.colors map=glc2000_eu rules=GLC_EU_V2.clr
ERROR: bad rule (syntax error):
> > How can I eliminate the spaces in front
> > > of each line (or how can I produce them better?)?
> > > Probably "sed" holds the answer but it takes time to learn.
> >
> > awk '{print}'
no effect
> > sed -e 's/^[ ]*//'
cat GLC_EU_V2.clr | head -28 | tail -25 | cut -d' ' -f2,3,4 | tr " "
":" | cat -n | sed -e 's/^[ ]*//'
1 0:99:0
2 0:150:0
3 175:255:99
4 140:68:17
5 204:127:96
6 140:191:0
7 119:150:255
8 0:71:198
9 0:229:0
10 0:0:0
11 255:119:0
12 255:178:0
13 255:234:158
14 221:201:160
15 0:150:150
16 255:224:229
17 255:117:232
18 201:137:255
19 181:181:181
20 137:226:255
21 239:239:239
22 255:0:0
23 255:183:193
24 255:255:255
25 255:255:255
> > sed -e 's/^\s*//'
The same as above
> > sed -e 's/^[:space:]*//'
no effect
More information about the grass-user
mailing list