# Access columns by variable name with \`readdlm\` from \`DelimitedFiles\`

**URL:** <https://discourse.julialang.org/t/access-columns-by-variable-name-with-readdlm-from-delimitedfiles/29918>\
**Category:** General Usage\
**Created:** [October 15, 2019, 2:15am UTC](https://discourse.julialang.org/t/access-columns-by-variable-name-with-readdlm-from-delimitedfiles/29918 "2019-10-15T02:15:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sergevic](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sergevic/32/9958_2.png) [@sergevic](https://discourse.julialang.org/u/sergevic)\
**Post date:** [October 15, 2019, 2:15am UTC](https://discourse.julialang.org/t/access-columns-by-variable-name-with-readdlm-from-delimitedfiles/29918/1 "2019-10-15T02:15:24Z")

</div>

Once again, the documentation of Julia is useless and provides no help. I read a `.txt` file with the command `data=readdlm("data.txt", header=true)` from the `DelimitedFiles` package. The result is a `Tuple` with the data separated from the headers. I want to call a certain column of the `data` object using the header name, just as `R` does `data$variable`. I tried `data[:"variable"]` and `data[:variable]` but with no success. How are we able to know how to treat the `header=true` option if there is no help on Julia documentation about that? I think a lot has to be done concerning the help pages in Julia. The other languages have more helpful documentation concerning their commands.

---

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [October 15, 2019, 2:24am UTC](https://discourse.julialang.org/t/access-columns-by-variable-name-with-readdlm-from-delimitedfiles/29918/2 "2019-10-15T02:24:36Z")

</div>

You’ll want to use a package like [CSV.jl](https://github.com/JuliaData/CSV.jl) or [CSVFiles.jl](https://github.com/queryverse/CSVFiles.jl) and read your data into a `DataFrame` for that kind of feature.

> Once again, the documentation of Julia is useless and provides no help.

So be the person that improves the documentation by opening a pull request with text that is better than what we have right now! Everything in julia land is done by volunteers, and helping improve the documentation is a great way to become a member of the community and giving back to all the folks that volunteered their time for free to create the functionality in the first place 🙂

---

<div class="post-metadata">

**Author:** ![sergevic](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sergevic/32/9958_2.png) [@sergevic](https://discourse.julialang.org/u/sergevic)\
**Post date:** [October 15, 2019, 2:29am UTC](https://discourse.julialang.org/t/access-columns-by-variable-name-with-readdlm-from-delimitedfiles/29918/3 "2019-10-15T02:29:59Z")

</div>

Yes I know and I agree with you 😉 Concerning your answer, is the `DataFrame` format the unique way to do that? Is it not possible to work with the `Array` format? So, what’s the point of providing a `header=true` option with the `readdlm` command if there is no use for that?

---

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [October 15, 2019, 3:15am UTC](https://discourse.julialang.org/t/access-columns-by-variable-name-with-readdlm-from-delimitedfiles/29918/4 "2019-10-15T03:15:26Z")

</div>

> [@sergevic](#):
>
> is the `DataFrame` format the unique way to do that?

No, there are many other tabular packages besides `DataFrame`, but `DataFrame` is by far the most popular and probably should be your starting point.

> So, what’s the point of providing a `header=true` option with the `readdlm` command if there is no use for that

There are lots of uses for it, but for your specific case other packages are a better choice.

---

<div class="post-metadata">

**Author:** ![sergevic](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sergevic/32/9958_2.png) [@sergevic](https://discourse.julialang.org/u/sergevic)\
**Post date:** [October 15, 2019, 3:26am UTC](https://discourse.julialang.org/t/access-columns-by-variable-name-with-readdlm-from-delimitedfiles/29918/5 "2019-10-15T03:26:11Z")

</div>

Ok thanks 😉
