# Load multiples NCDataset

**URL:** https://discourse.julialang.org/t/load-multiples-ncdataset/54717
**Category:** General Usage
**Tags:** question, package
**Created:** [February 6, 2021, 5:57am UTC](https://discourse.julialang.org/t/load-multiples-ncdataset/54717 "2021-02-06T05:57:30Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![wulan87](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wulan87/32/20084_2.png) [@wulan87](https://discourse.julialang.org/u/wulan87)
#### Post date: [February 6, 2021, 5:57am UTC](https://discourse.julialang.org/t/load-multiples-ncdataset/54717/1 "2021-02-06T05:57:30Z")

</div>

Hello here I am working with multiple netcdf MODIS datas using NCDataset.jl.  
I don’t know how “fnames” mean by vector files, below is the example to load datas from documentation.

mfds = NCDataset(fnames,mode = “r”; aggdim = nothing, deferopen = true, \_aggdimconstant = false)

let say I have this list data in my directory, how can I make it by vector files (of fnames)?

TERRA\_MODIS.20000224.L3m.DAY.SST.sst.4km.nc  
TERRA\_MODIS.20000225.L3m.DAY.SST.sst.4km.nc  
TERRA\_MODIS.20000226.L3m.DAY.SST.sst.4km.nc

or is there any method to load multiples .nc datas?

---

<div class="post-metadata">

### Author: ![visr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/visr/32/17204_2.png) [@visr](https://discourse.julialang.org/u/visr)
#### Post date: [February 6, 2021, 9:08am UTC](https://discourse.julialang.org/t/load-multiples-ncdataset/54717/2 "2021-02-06T09:08:40Z")

</div>

Any AbstractArray with AbstractString elements will work there. This is not directly mentioned in the [documentation entry](https://alexander-barth.github.io/NCDatasets.jl/latest/dataset/#NCDatasets.NCDataset), but if you click the blue “source” button on the bottom right, you can see the type signature in the code.

So you could do

```julia
fnames = [
    "TERRA_MODIS.20000224.L3m.DAY.SST.sst.4km.nc",
    "TERRA_MODIS.20000225.L3m.DAY.SST.sst.4km.nc",
    "TERRA_MODIS.20000226.L3m.DAY.SST.sst.4km.nc"
]

```

Or you could use [https://github.com/vtjnash/Glob.jl:](https://github.com/vtjnash/Glob.jl:)

```julia
using Glob
fnames = glob("TERRA_MODIS.*.L3m.DAY.SST.sst.4km.nc", directory)

```

---

<div class="post-metadata">

### Author: ![wulan87](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wulan87/32/20084_2.png) [@wulan87](https://discourse.julialang.org/u/wulan87)
#### Post date: [February 9, 2021, 9:28am UTC](https://discourse.julialang.org/t/load-multiples-ncdataset/54717/3 "2021-02-09T09:28:25Z")

</div>

Thank you.
