# 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:** 14

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [August 21, 2021, 8:21am UTC](https://discourse.julialang.org/t/how-to-repeat-the-format-in-printf/66695/14 "2021-08-21T08:21:02Z")

</div>

@CRquantum, you could write like this (_added carriage return for better formatting_):

```julia
f = Printf.Format("%9.3f"^4*"\n")
io = open("myfile2.txt", "w")
for i in 1:10
    Printf.format(io, f, 1,2,3,4)
end
close(io)

```

---

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