# How to repeat the format in @printf?

**URL:** <https://discourse.julialang.org/t/how-to-repeat-the-format-in-printf/66695>\
**Category:** General Usage\
**Tags:** io\
**Created:** [August 19, 2021, 11:48pm UTC](https://discourse.julialang.org/t/how-to-repeat-the-format-in-printf/66695 "2021-08-19T23:48:58Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![CRquantum](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/crquantum/32/27824_2.png) [@CRquantum](https://discourse.julialang.org/u/CRquantum)\
**Post date:** [August 24, 2021, 6:01am UTC](https://discourse.julialang.org/t/how-to-repeat-the-format-in-printf/66695/17 "2021-08-24T06:01:29Z")

</div>

Thank you very much!  
Yes I tried,

```
a = [1.0, 2.0, 3.0, 4.0]
f = Ref(Printf.Format("%5.2f"));
str = Printf.format.(f,a)

```

This gives me a 4-element Vector{String} which should be correct. However, when I write to a file by,

```
io = open("fileout.txt", "a") 
write(io, str)
close(io)

```

It gives an error

```
`write` is not supported on non-isbits arrays

```

It seems write can only operator on one string? I am sure write can handle an array but I am not sure how to do it.

---

_[View the full topic](https://discourse.julialang.org/t/how-to-repeat-the-format-in-printf/66695)._
