datamash issue
Karl Auer
kauer at biplane.com.au
Fri Apr 24 23:45:31 UTC 2020
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.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer at biplane.com.au)
http://www.biplane.com.au/kauer
http://twitter.com/kauer389
GPG fingerprint: 2561 E9EC D868 E73C 8AF1 49CF EE50 4B1D CCA1 5170
Old fingerprint: 8D08 9CAA 649A AFEF E862 062A 2E97 42D4 A2A0 616D
More information about the ubuntu-users
mailing list