# Collecting data by allocatable array

**URL:** <https://discourse.julialang.org/t/collecting-data-by-allocatable-array/105484>\
**Category:** General Usage\
**Tags:** question\
**Created:** [October 27, 2023, 2:50pm UTC](https://discourse.julialang.org/t/collecting-data-by-allocatable-array/105484 "2023-10-27T14:50:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Photon](https://avatars.discourse-cdn.com/v4/letter/p/b5a626/32.png) [@Photon](https://discourse.julialang.org/u/Photon)\
**Post date:** [October 27, 2023, 2:50pm UTC](https://discourse.julialang.org/t/collecting-data-by-allocatable-array/105484/1 "2023-10-27T14:50:01Z")

</div>

Suppose there is a file, containing a series of data, and the number of data is unknown before reading the file.

To collect all data in this file, is there a kind of array in Julia for this purpose, just like the allocatable type array in Fortran or is there any other way to collect all data through Julia?

Would anyone please give me some hints?

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [October 27, 2023, 3:31pm UTC](https://discourse.julialang.org/t/collecting-data-by-allocatable-array/105484/2 "2023-10-27T15:31:43Z")

</div>

Juila’s `Vector{}` can be `push!()`ed to, its length is not fixed
