# If I have the following data in txt, how can I read the number 100?

**URL:** https://discourse.julialang.org/t/if-i-have-the-following-data-in-txt-how-can-i-read-the-number-100/12969
**Category:** General Usage
**Tags:** question
**Created:** [August 7, 2018, 4:58am UTC](https://discourse.julialang.org/t/if-i-have-the-following-data-in-txt-how-can-i-read-the-number-100/12969 "2018-08-07T04:58:55Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![chdlkl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chdlkl/32/4835_2.png) [@chdlkl](https://discourse.julialang.org/u/chdlkl)
#### Post date: [August 7, 2018, 4:58am UTC](https://discourse.julialang.org/t/if-i-have-the-following-data-in-txt-how-can-i-read-the-number-100/12969/1 "2018-08-07T04:58:55Z")

</div>

```julia
100 # the number 100

```

---

<div class="post-metadata">

### Author: ![stillyslalom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stillyslalom/32/45687_2.png) [@stillyslalom](https://discourse.julialang.org/u/stillyslalom)
#### Post date: [August 7, 2018, 5:37am UTC](https://discourse.julialang.org/t/if-i-have-the-following-data-in-txt-how-can-i-read-the-number-100/12969/2 "2018-08-07T05:37:59Z")

</div>

If it’s just a raw string, try `parse(Int, split(str)[1])`.  
If it’s in a file, use `parse(Int, readuntil("filename.txt", '#'))`

[`readdlm`](https://docs.julialang.org/en/latest/stdlib/DelimitedFiles/#DelimitedFiles.readdlm-Tuple%7BAny,AbstractChar,Type,AbstractChar%7D) is a good general solution for this sort of application: `readdlm("filename.txt")[1]`

---

<div class="post-metadata">

### Author: ![chdlkl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chdlkl/32/4835_2.png) [@chdlkl](https://discourse.julialang.org/u/chdlkl)
#### Post date: [August 7, 2018, 7:37am UTC](https://discourse.julialang.org/t/if-i-have-the-following-data-in-txt-how-can-i-read-the-number-100/12969/3 "2018-08-07T07:37:09Z")

</div>

```julia
thank u very much!!!

```
