SourceForge has been redesigned. Learn more.
Close

editing char variable

Help
mark
2012-11-09
2013-10-17
  • mark

    mark - 2012-11-09

    Hello,
    one of variables in a netcdf file is a char (string) type. Is it possible to edit/change it with nco?
    Thanks,
    Mark

     
  • Charlie Zender

    Charlie Zender - 2012-11-09

    yes, use ncap2, e.g.,
    zender@roulee:~/crr$ ncap2 -O -s 'foo=fl_nm_arr;print(foo);foo(0,0:6)="charlie";print(foo)' ~/nco/data/in.nc ~/foo.nc
    foo="/data/zender/dstccm04/dstccm04_8589_01.nc"
    foo="/data/zender/dstccm04/dstccm04_8589_02.nc"
    foo="/data/zender/dstccm04/dstccm04_8589_03.nc"

    foo="charlieender/dstccm04/dstccm04_8589_01.nc"
    foo="/data/zender/dstccm04/dstccm04_8589_02.nc"
    foo="/data/zender/dstccm04/dstccm04_8589_03.nc"

     

Log in to post a comment.