datamash issue

Dave Stevens geek at uniserve.com
Sun Apr 26 20:31:52 UTC 2020


On Sat, 25 Apr 2020 09:45:31 +1000
Karl Auer <kauer at biplane.com.au> wrote:

> On Fri, 2020-04-24 at 15:29 -0700, Dave Stevens wrote:
> > cat /home/dave/node_modules/plantower/atbarrys/$target.csv |
> > datamash -W mean 3 -R 1 --no-strict
> > [...]
> > cat: /home/dave/node_modules/plantower/atbarrys/.csvdatamash:
> > invalid option -- 'R'
> > [...]
> > cat byminute.csv | datamash mean 1  -R 1
> > 29.5
> > 
> > which is correct and as I wish it to be.
> > 
> > I can not see why one works and the other doesn't. Does anyone have
> > a suggestion?  
> 
> Your working test does not use the same options and parameters as the
> non-working one, so is not a proper test.
> 
> Also, it seems that $target is undefined.
> 
> Did you cut and paste the above details out of your terminal? There
> are a few things that suggest you typed them into your email or did
> not cut and paste everything. Like the missing pipe and delimiters
> resulting in ".csvdatamash", and the fact that this looks like cat is
> complaining about R when I'd have expected it to complain about W.
> Alternatively, if that is literally what you are seeing, then they
> could be symptoms of the problem.
> 
> Using cat with programs that can accept standard input is a waste of a
> process. You can (probably) fix the above problem (and stop offending
> the purists) by just redirecting your file directly into datamash,
> like this:
> 
>    datamash -W mean 3 -R 1 --no-strict < $target.csv
> 
> Regards, K.
> 

Hi Karl,

After looking this over I realize that I have unintentionally misled
you. The lines I showed are part of a script (in the error case) and
standalone in the second case. $target is defined when the script runs
without the -R and works fine. I'll need to work on this more before
taking your attention again, thanks for your observations.

Dave

-- 
Affectionate tactile stimulation is a primary need, a need which must
be satisfied if the infant is to develop as a healthy human being.

And what is a healthy human being? One who is able to love, to work, to
play, and to think critically and unprejudicially.

--  Ashley Montagu – Touching, The human significance of the skin. 2e
1978




More information about the ubuntu-users mailing list