# How to add new var(matix , ...) to existing jld file and keep existing vars

**URL:** <https://discourse.julialang.org/t/how-to-add-new-var-matix-to-existing-jld-file-and-keep-existing-vars/1567>\
**Category:** General Usage\
**Tags:** jld, hdf5\
**Created:** [January 18, 2017, 12:15pm UTC](https://discourse.julialang.org/t/how-to-add-new-var-matix-to-existing-jld-file-and-keep-existing-vars/1567 "2017-01-18T12:15:04Z")\
**Posts on this page:** 2\
**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:** [January 18, 2017, 12:15pm UTC](https://discourse.julialang.org/t/how-to-add-new-var-matix-to-existing-jld-file-and-keep-existing-vars/1567/1 "2017-01-18T12:15:04Z")

</div>

How to add new “B” var(matix , …) to existing jld file and keep existing vars “A”

julia\> using HDF5,JLD  
julia\> A=10  
julia\> save(“File.jld”,“A”,A)  
julia\> B=5  
???  
Paul

---

<div class="post-metadata">

**Author:** ![Simon\_Bolland](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simon_bolland/32/8920_2.png) [@Simon\_Bolland](https://discourse.julialang.org/u/Simon_Bolland)\
**Post date:** [January 18, 2017, 12:26pm UTC](https://discourse.julialang.org/t/how-to-add-new-var-matix-to-existing-jld-file-and-keep-existing-vars/1567/2 "2017-01-18T12:26:43Z")

</div>

Try:

````julia
save("File.jld","A",A)
B=5
f=jldopen("File.jld","r+")
write(f,"B",B)
close(f)```
````
