# How to read specific columns of a csv file

**URL:** <https://discourse.julialang.org/t/how-to-read-specific-columns-of-a-csv-file/86644>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [September 1, 2022, 2:34pm UTC](https://discourse.julialang.org/t/how-to-read-specific-columns-of-a-csv-file/86644 "2022-09-01T14:34:26Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [September 1, 2022, 2:42pm UTC](https://discourse.julialang.org/t/how-to-read-specific-columns-of-a-csv-file/86644/2 "2022-09-01T14:42:22Z")

</div>

In your case it’s either

```julia
y_train = CSV.File("test.csv"; select=[1])

```

or

```julia
y_train = CSV.File("test.csv"; select=[:a])

```

see [Examples · CSV.jl](https://csv.juliadata.org/stable/examples.html#select_example)

---

_[View the full topic](https://discourse.julialang.org/t/how-to-read-specific-columns-of-a-csv-file/86644)._
