# Scanf Problem

**URL:** <https://discourse.julialang.org/t/scanf-problem/133946>\
**Category:** General Usage\
**Created:** [November 17, 2025, 7:29pm UTC](https://discourse.julialang.org/t/scanf-problem/133946 "2025-11-17T19:29:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jake](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jake/32/46007_2.png) [@Jake](https://discourse.julialang.org/u/Jake)\
**Post date:** [November 17, 2025, 7:29pm UTC](https://discourse.julialang.org/t/scanf-problem/133946/1 "2025-11-17T19:29:41Z")

</div>

In trying to read a line and convert it to variables my @scanf statement is giving unexpected (wrong) results. I am wondering if another set of eyes can pick out what I am doing wrong.

```julia-auto
julia> using Scanf

julia> record4 = " 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 5.2706007E-02"
" 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 5.2706007E-02"

julia> n, uv1, uv2, uv3, uv4, uv5 = @scanf(record4, "%e15.7%e15.7%e15.7%e15.7%e15.7", Float64, Float64, Float64, Float64, Float64)
(1, 0.0, 0.0, 0.0, 0.0, 0.0)

julia>

```

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [November 17, 2025, 7:45pm UTC](https://discourse.julialang.org/t/scanf-problem/133946/2 "2025-11-17T19:45:55Z")

</div>

> [@Jake](#):
>
> `%e15.7`

This is your issue: you need to put the modifiers between the `%` and the `e`, but scanf doesn’t support restricting the decimal digits like that. The integer in `%15e` is the maximum _total number_ of characters to consume. I’d just do `"%e%e%e%e%e"`.

---

<div class="post-metadata">

**Author:** ![Jake](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jake/32/46007_2.png) [@Jake](https://discourse.julialang.org/u/Jake)\
**Post date:** [November 17, 2025, 8:35pm UTC](https://discourse.julialang.org/t/scanf-problem/133946/3 "2025-11-17T20:35:23Z")

</div>

This example should be added to the scanf documentation then?
