Project

General

Profile

Help to chain sinfon with cat operator in CDO

Added by Kendy Silvério over 6 years ago

Dear All,

I am applying cdo for the attached file to extract file.txt.

For that, I use cdo infon ecmwf_1-7_DJF_ev.nc|grep -e anom >ecmwf_1-7_anom.txt, then I use

cat ecmwf_1-7_anom.txt|tr -s " "|cut -d ' ' -f10 |tail -n +60 |head -n -31 >ecmwf_1-7_an.txt and it works well.

However, I would like to chain the above syntaxis in one commandline, which I am planing to use in bash script.

Can anyone please help me?

I apologise if I am not clear. But I would be happy to answer any questions if you have any.

Thank you so much for your help in advance.


Replies (2)

RE: Help to chain sinfon with cat operator in CDO - Added by Karin Meier-Fleischer over 6 years ago

Hi Kendy,

you can pipe the output directly to the tr command, no redirection, no ecmwf_1-7_anom.txt!

cdo infon ecmwf_1-7_DJF_ev.nc | grep -e anom | tr -s " "| cut -d ' ' -f10 | tail -n +60 | head -n -31 > ecmwf_1-7_an.txt

-Karin

RE: Help to chain sinfon with cat operator in CDO - Added by Kendy Silvério over 6 years ago

Karin Meier-Fleischer, it works.So that, thank you very much.

Kenedy

    (1-2/2)