You can use the attribute ..nvars attributes.let num = ..nvarsThe variable 'num' will store the number of variables (9 in your case) in the netCDF file opened. More details can be found here.On Mon, Jun 3, 2019 at 12:29 PM Satyesh Ghetiya <satyeshghetiya@xxxxxxxxx> wrote:Sorry for the typing mistake, corrected question:Suppose I have an .nc file with 9 variables in it ( say v1, v2, v3 . . . . v9 ).How to get number of variables from any such .nc file (without counting manually from .nc) ? ( I want a command which gives 9 as answer in above example)Sincerely ,G Satyesh ,IndiaOn Mon, Jun 3, 2019 at 12:27 PM Satyesh Ghetiya <satyeshghetiya@xxxxxxxxx> wrote:Dear all,,Suppose I have an .nc file with 9 variables in it (say v1, v2, v3 . . . . v9).How to get number of variables from any such .nc file (without counting manually from .nc) ? ( I want a command which gives 19 as answer in above example)Sincerely,G Satyesh,India.--G Satyesh
--Lijo Abraham JosephResearch Scholar,Indian National Centre for Ocean Information Services (INCOIS),Hyderabad