# File name depending on the index

**URL:** <https://discourse.julialang.org/t/file-name-depending-on-the-index/36407>\
**Category:** New to Julia\
**Created:** [March 23, 2020, 9:13pm UTC](https://discourse.julialang.org/t/file-name-depending-on-the-index/36407 "2020-03-23T21:13:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![angeloaliano1](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Post date:** [March 23, 2020, 9:13pm UTC](https://discourse.julialang.org/t/file-name-depending-on-the-index/36407/1 "2020-03-23T21:13:15Z")

</div>

Dear all,  
I need to save an archive with a variable X by using the package FileIO and JLD2.  
The variable X is a loop that depend on index i.  
The command to save this variable is:

```julia
FileIO.save("Filename.jld2","RE",X)

```

Is possible change the file name with the index i, i.e, “Filename” depending on the i?  
Best regards.

---

<div class="post-metadata">

**Author:** ![hendri54](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hendri54/32/9621_2.png) [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Post date:** [March 23, 2020, 10:07pm UTC](https://discourse.julialang.org/t/file-name-depending-on-the-index/36407/2 "2020-03-23T22:07:46Z")

</div>

Do you mean?

```julia
julia> idx = 10
10

julia> "Filename$idx.jld2"
"Filename10.jld2"

```

---

<div class="post-metadata">

**Author:** ![angeloaliano1](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Post date:** [March 23, 2020, 10:24pm UTC](https://discourse.julialang.org/t/file-name-depending-on-the-index/36407/3 "2020-03-23T22:24:19Z")

</div>

> [@hendri54](#):
>
> Do you mean?

Perfect!
