recode implementation (was: recode, get sample, and get columns)

Bernhard Reiter bernhard at intevation.de
Fri Aug 12 15:30:32 CEST 2005


Hi Jakson,

Am 12. Aug 2005 um 08:31:44 schrieb Jakson Aquino:
> Em Qui 11 Ago 2005 11:47, Bernhard Reiter escreveu:

> What about if we turn all options to the new style of 
> using "--" for full option name and "-" for 
> abbreviations? The old style could still be accepted by 
> produce a warning that it is deprecated and will no 
> longer be supported in future releases. Only the new 
> style would be documented.

Changes in statist have been slow for a long while
and there is no immedeate reasons to force all scripts to
the new options format.
I would say that we should in any case use the long format
for the new long options.
We could add "--" versions for the old long options, too
and have the warning that at some unknown point in the future
the "-" versions will be deprecated.

> >         I ask myself if using "awk" or python for
> > this kind of reformatting would be better as it is
> > more general and not much more verbose. Or the other
> > way around: What is the advantage of using Statist
> > for this?
> 
> You are correct! I simply don't know how to program 
> with python, and I didn't know the existence of awk 
> until some days ago. 

I did not now that you did not know. 
There is a book called
	Brian W. Kernighan & Rob Pike, 
	The Unix Programming Environment, 1984, Prentice-Hall.

which teaches a lot about how to use small commands to assemble a
more complicated operation.

> I even thought about removing recode.c from statist, 
> but I think that the syntax of a "recode_config_file" is still simpler 
> than the syntax of awk, at least for people who don't 
> know how to program in C. 

The question to consider is: Does the additional effort of learning
statist's syntax and maintaining the code help more then
learing recepies in a standard language?
If yes, you can keep the code. 
Otherwise removing it, will keep statist cleaner.

Usually standard languages have knowledge that is useful in other
circumstances as well. This is why I prefer python in many cases now,
though smaller operations tend to be longer than in awk.

> I still didn't find a tool for merging databases. I 
> tried "join", but the results weren't satisfactory.
> Perhaps I don't have enough knowledge on how to use 
> join.

Can you describe what you want to do?
As far as I can see "join" will need a matching keyword in both tables.
Maybe you want "paste"?

     $ cat num2
     1
     2
     $ cat let3
     a
     b
     c
     $ paste num2 let3
     1       a
     2       b
             c

Best,
	Bernhard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.intevation.de/pipermail/statist-list/attachments/20050812/419807a8/attachment.bin


More information about the Statist-list mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)