Re: forcing input type when filename wrong

From: Dave Allured <dave.allured_at_nyahnyahspammersnyahnyah>
Date: Fri, 24 Apr 2009 13:41:56 -0600

Mark,

The addfile function supports this, though the method is not very
intuitive. Just concatenate the extension for the desired format on
the end of the actual file name, and addfile will do the right
thing. See example 2 on the addfiles page.

   f = addfile (wrongname + ".nc", "r")

http://www.ncl.ucar.edu/Document/Functions/Built-in/addfile.shtml

Dave Allured
CU/CIRES Climate Diagnostics Center (CDC)
http://cires.colorado.edu/science/centers/cdc/
NOAA/ESRL/PSD, Climate Analysis Branch (CAB)
http://www.cdc.noaa.gov/psd1/

Mark.Collier_at_csiro.au wrote:
> Hi,
> sometimes we have to deal with large quantities of files
> which are wrongly named, for example, netcdffiles not
> ending with the .nc suffix. Is there same way of getting
> around this in NCL without having to call on the system
> command, like creating an internal symbolic link or a
> fake file name pointing to the online one, or using
> something like setfileoptions (which I think only works
> for writing to new files, not reading)?
>
> Many thanks,
> Mark.
>
> CSIRO Marine and Atmospheric Research
> Australia.
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Apr 24 2009 - 13:41:56 MDT

This archive was generated by hypermail 2.2.0 : Fri Apr 24 2009 - 14:12:40 MDT