divc - Too many streams
Added by Angela Meyer over 10 years ago
Hi,
Assume cdo output file1
returns a single number, like 1.23. Then
c=`cdo output file1`
cdo divc,$c ifile ofile
returns "cdo divc (Abort): Too many streams! Operator needs 1 input and 1 output streams."
I tried using eval
in bash to make c
a constant but without success. What am I missing here?
Replies (1)
RE: divc - Too many streams - Added by Jaison-Thomas Ambadan over 10 years ago
c=`cdo output file1`
cdo divc,$c ifile ofile
I think the "space" character in $c is creating the problem. If file1 contains only a single number, try:
cdo -divc,$(cdo output file1 | sed -e 's/^ *//' -e 's/ *$//') ifile ofile or cdo -divc,$(cdo output file1 | awk '{print $1}') ifile ofile
here is an example:
cdo output -divc,$(cdo output -fldmean -topo | awk '{print $1}') -topo
Cheers,
J