REPLACE¶
The REPLACE command is similar to the CALC command, except that the column specifier (col
) in the expression indicates an existing column (or columns) that will be replaced with the expression value. It is possible to refer to the column being changed via #rc
, which denotes the “column at hand/in context” when a multicolumn expression is done in replace.
Note #rc
is always a string so if you want to compare with size then use something like: if(isfloat(#rc),if(float(#rc)>2.0,2.0,float(#rc)),‘NaN’)
It can be preferable to use this command instead of the SED command in many cases.
Usage¶
gor ... | REPLACE col(s) expression
Examples¶
... | REPLACE colx,coly,sum_* IF(#rc in ('.',';'),'',#rc).