# JLD file , how to add new line to existing array in jld file?

**URL:** <https://discourse.julialang.org/t/jld-file-how-to-add-new-line-to-existing-array-in-jld-file/31447>\
**Category:** General Usage\
**Created:** [November 24, 2019, 9:34am UTC](https://discourse.julialang.org/t/jld-file-how-to-add-new-line-to-existing-array-in-jld-file/31447 "2019-11-24T09:34:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![programista](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/programista/32/5372_2.png) [@programista](https://discourse.julialang.org/u/programista)\
**Post date:** [November 24, 2019, 9:34am UTC](https://discourse.julialang.org/t/jld-file-how-to-add-new-line-to-existing-array-in-jld-file/31447/1 "2019-11-24T09:34:24Z")

</div>

Ho to add new data to existingg Array in jld file

```julia
julia> f=jldopen("file.jld","w")
julia> close(f)
julia> f=jldopen("file.jld","r+")
julia> write(f,"A",rand(5,5))
julia> read(f,"A")
5×5 Array{Float64,2}:
 0.626607 0.14594 0.343371 0.114918 0.306783
 0.854831 0.00995706 0.838906 0.179565 0.269296
 0.941415 0.951582 0.470253 0.703651 0.862343
 0.686263 0.20181 0.952839 0.846292 0.522481
 0.486758 0.0271853 0.795502 0.055506 0.207617

```

How to add new vector (as new row or column )b=rand(5)  
Thanks, Paul

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [November 24, 2019, 9:59am UTC](https://discourse.julialang.org/t/jld-file-how-to-add-new-line-to-existing-array-in-jld-file/31447/2 "2019-11-24T09:59:31Z")

</div>

Since JLD is basically augmented HDF5, you should be able to use [HDF5.jl](https://github.com/JuliaIO/HDF5.jl)’s `set_dim!` to resize the dataset and then insert the new data. If I find the time, I’ll post an example.

---

<div class="post-metadata">

**Author:** ![programista](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/programista/32/5372_2.png) [@programista](https://discourse.julialang.org/u/programista)\
**Post date:** [November 24, 2019, 10:02am UTC](https://discourse.julialang.org/t/jld-file-how-to-add-new-line-to-existing-array-in-jld-file/31447/3 "2019-11-24T10:02:57Z")

</div>

Thanks I found , `set_dim!` with s `set_dims!`  
Paul

---

<div class="post-metadata">

**Author:** ![programista](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/programista/32/5372_2.png) [@programista](https://discourse.julialang.org/u/programista)\
**Post date:** [November 24, 2019, 3:07pm UTC](https://discourse.julialang.org/t/jld-file-how-to-add-new-line-to-existing-array-in-jld-file/31447/4 "2019-11-24T15:07:49Z")

</div>

In next post about adding String in JLD, plese look !
