[ncl-talk] error for nc to text
Dave Allured - NOAA Affiliate
dave.allured at noaa.gov
Tue Sep 16 15:52:30 MDT 2014
Azizul,
Okay, I see another error in the command. The -v option needs a variable
name following it. You have only -v directly followed by a file name.
This will confuse ncks into thinking that "pr_...nc" is a variable name,
and there is no input file.
Simply insert the missing variable name such as "pr" after -v, and I think
it should work. Or else, remove -v if you want to convert all variables in
the file. Sorry I did not catch this before.
--Dave
On Tue, Sep 16, 2014 at 3:24 PM, azizul haque <haque.azizul320 at yahoo.com>
wrote:
>
> Hi Dave,
> Thank you very much for your quick reply. Its work but I am getting only
string. not value
>
> any suggestion
> regards
> azizul
> ncks: ERROR received 0 filenames; need at least one
> ncks Command line options cheatsheet (full details at
http://nco.sf.net/nco.html#ncks):
> ncks [-3] [-4] [-5] [-6] [-7] [-A] [-a] [-b fl_bnr] [--bfr sz] [-C] [-c]
[--cdl] [--cnk_byt sz] [--cnk_dmn nm,sz] [--cnk_map map] [--cnk_plc plc]
[--cnk_scl sz] [-D nco_dbg_lvl] [-d ...] [-F] [--fix_rec_dmn dim] [--fl_fmt
fmt] [-G grp:lvl] [-g ...] [-H] [-h] [--hdn] [--hdr_pad nbr] [-L lvl] [-l
path] [-M] [-m] [--md5_dgs] [--md5_wrt] [--mk_rec_dmn dim] [--msa]
[--no_blank] [--no_tmp_fl] [-O] [-o out.nc] [-P] [-p path] [-Q] [-q] [-R]
[-r] [--rad] [--ram_all] [-s format] [-u] [--unn] [-v ...] [-X box] [-x]
[--xml] [--xml_no_loc] [--xml_spr_chr sng] [--xml_spr_nmr sng] in.nc [[
out.nc]]
>
> -3, --3, --fl_fmt=classic Output file in netCDF3 CLASSIC (32-bit offset)
storage format
> -4, --4, --netcdf4 Output file in netCDF4 (HDF5) storage format
> -5, --5, Print alphabetically by group then variable
> -6, --6, --64, --fl_fmt=64bit Output file in netCDF3 64-bit offset
storage format
> -7, --7, --fl_fmt=netcdf4_classic Output file in netCDF4 CLASSIC format
(3+4=7)
> -A, --apn, --append Append to existing output file, if any
> -a, --abc, --alphabetize Disable alphabetization of extracted variables
> -b, --fl_bnr, --binary-file fl_bnr Unformatted binary file to write
> --bfr_sz, --buffer_size sz Buffer size to open files with
> -C, --nocoords Associated coordinate variables should not be processed
> -c, --crd, --coords Coordinate variables will all be processed
> --cdl Print CDL (netCDF lingua franca used by ncdump/ncgen)
> --cnk_dmn, --chunk_dimension nm,sz Chunksize of dimension nm is sz
> --cnk_map, --chunk_map map Chunking map
[dmn,lfp,prd,rd1,rew,scl,xpl,xst]
> --cnk_plc, --chunk_policy plc Chunking policy
[all,g2d,g3d,xpl,xst,uck]
> --cnk_scl, --chunk_scalar sz Chunksize scalar (for all dimensions)
> -D, --dbg_lvl, --debug-level lvl Debug-level is lvl
> -d, --dmn, --dimension dim,[min][,[max]][,[stride]] Dimension's limits
and stride in hyperslab
> -F, --ftn, --fortran Fortran indexing conventions (1-based) for I/O
> --fix_rec_dmn dim Change dimension dim (or all) to fixed dimension in
output file
> --fl_fmt, --file_format fmt File format
[classic,64bit,netcdf4,netcdf4_classic]
> -G, --gpe [grp_nm][:[lvl]] Group Path Editing path, levels to replace
> -g, --grp grp1[,grp2[...]] Group(s) to process (regular expressions
supported)
> -H, --data, --hieronymus Toggle printing data
> -h, --hst, --history Do not append to "history" global attribute
> --hdn, --hidden Print hidden (aka special) attributes
> --hdr_pad, --header_pad Pad output header with nbr bytes
> -L, --dfl_lvl, --deflate lvl Lempel-Ziv deflation (lvl=0..9) for netCDF4
output
> -l, --lcl, --local path Local storage path for remotely-retrieved files
> -M, --Mtd, --Metadata Toggle printing global metadata
> -m, --mtd, --metadata Toggle printing variable metadata
> --mk_rec_dmn dim Define dim as record dimension in output file
> --no_blank Print numeric missing values instead of blanks
(underscores)
> --no_tmp_fl Do not write output to temporary file
> -o, --output, --fl_out fl_out Output file name (or use last positional
argument)
> -O, --ovr, --overwrite Overwrite existing output file, if any
> -P, --prn, --print Print data, metadata, and units. Abbreviation for -C
-H -M -m -u.
> -p, --pth, --path path Path prefix for all input filenames
> -Q, Toggle printing of dimension indices and coordinate values
> -q, --quiet Turn off all printing to screen
> -R, --rtn, --retain Retain remotely-retrieved files after use
> -r, --revision, --vrs, --version Compile-time configuration and/or
program version
> --orphan, --rph_dmn Retain or print all (including orphaned)
dimensions
> --ram_all, --diskless_all Open netCDF3 files and create output files
in RAM
> -s, --sng_fmt, --string format String format for text output
> -u, --units Toggle printing units of variables, if any
> --unn, --union Select union of specified groups and variables
> -v, --variable var1[,var2[...]] Variable(s) to process (regular
expressions supported)
> -X, --auxiliary lon_min,lon_max,lat_min,lat_max Auxiliary coordinate
bounding box
> -x, --xcl, --exclude Extract all variables EXCEPT those specified with -v
> --xml Print XML (NcML, netCDF Markup Language)
> --xml_no_location Omit NcML location element
> --xml_spr_chr sng Separator for NcML character types
> --xml_spr_nmr sng Separator for NcML numeric types
> in.nc Input file name
> out.nc Output file name (or use -o switch)
>
> Eight ways to find more help on ncks and/or NCO:
> 1. Examples: http://nco.sf.net/nco.html#xmp_ncks
> 2. Ref. manual: http://nco.sf.net/nco.html#ncks
> 3. User's Guide: http://nco.sf.net#RTFM
> 4. Manual pages: 'man ncks', 'man nco', ...
> 5. Homepage: http://nco.sf.net
> 6. FAQ: http://nco.sf.net#FAQ
> 7. Help Forum: http://sf.net/projects/nco/forums/forum/9830
> 8. Publications: http://nco.sf.net#pub
> Post questions, suggestions, patches at http://sf.net/projects/nco
>
> On Tuesday, 16 September 2014, 14:47, Dave Allured - NOAA Affiliate <
dave.allured at noaa.gov> wrote:
>
> Azizul,
>
> This command uses Unix output redirection. You need a "greater than"
sign in front of the output file name, like this:
>
> ncks -s '%e \n' -C -v pr_day_cnrm-cm5_mean_sa.nc >
pr_day_cnrm-cm5_mean_sa.txt
>
> --Dave
>
> On Tue, Sep 16, 2014 at 2:18 PM, azizul haque <haque.azizul320 at yahoo.com>
wrote:
> >
> > Hi All,
> > I am trying to convert nc time dimension to text using
> >
> > ***ncks -s '%e \n' -C -v pr_day_cnrm-cm5_mean_sa.nc
pr_day_cnrm-cm5_mean_sa.txt***
> >
> > and getting following error
> >
> > ***ERROR file pr_day_cnrm-cm5_mean_sa.txt neither exists locally nor
matches remote filename patterns***
> >
> > Appreciated for your kind help
> > regards
> > Azizul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140916/72c0f7ee/attachment.html
More information about the ncl-talk
mailing list