# Readtable with DataFrame v0.21.3

**URL:** https://discourse.julialang.org/t/readtable-with-dataframe-v0-21-3/42226
**Category:** Data
**Tags:** dataframes
**Created:** [June 29, 2020, 4:27am UTC](https://discourse.julialang.org/t/readtable-with-dataframe-v0-21-3/42226 "2020-06-29T04:27:55Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Ernesto\_Diaz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ernesto_diaz/32/8289_2.png) [@Ernesto\_Diaz](https://discourse.julialang.org/u/Ernesto_Diaz)
#### Post date: [June 29, 2020, 4:27am UTC](https://discourse.julialang.org/t/readtable-with-dataframe-v0-21-3/42226/1 "2020-06-29T04:27:55Z")

</div>

I need read a .txt file. The structure: red=DataFrames.readtable(“I:/Julia/CHO/cho1.txt”,allowcomments=true,separator=’ ')  
worked with DataFrames v0.20.0 but not run with v0.21.3 (UndefVarError: readtable not defined)  
How can I solve this problem?

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [June 29, 2020, 8:20am UTC](https://discourse.julialang.org/t/readtable-with-dataframe-v0-21-3/42226/2 "2020-06-29T08:20:34Z")

</div>

See [here](https://github.com/JuliaData/DataFrames.jl/commit/8be3bc46955cd244cdd0981d40d497ffdc335daf#diff-f703c426be50b4bbe69472caef0aa2feL1099):

```julia
Base.depwarn("readtable is deprecated, use CSV.read from the CSV package instead",
                 :readtable)

```

Although that deprecation message funnily is sort of deprecated itself, as CSV just deprecated `CSV.read` as of the latest v0.7.

So in short use `DataFrame!(CSV.File(path))`

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [March 15, 2024, 12:58pm UTC](https://discourse.julialang.org/t/readtable-with-dataframe-v0-21-3/42226/3 "2024-03-15T12:58:43Z")

</div>

Just because someone just liked the above post and I can’t edit it: my old post is deprecated, we’ve come full circle, these days do:

```julia
using CSV, DataFrames

CSV.read(path, DataFrame)

```

---

<div class="post-metadata">

### Author: ![phantom](https://avatars.discourse-cdn.com/v4/letter/p/e0b2c6/32.png) [@phantom](https://discourse.julialang.org/u/phantom)
#### Post date: [March 15, 2024, 2:01pm UTC](https://discourse.julialang.org/t/readtable-with-dataframe-v0-21-3/42226/4 "2024-03-15T14:01:33Z")

</div>

> [@nilshg](#):
>
> DataFrame!(CSV.File(path))

Thanks for the heads up. Why does the order of the file paths matter? In the case of single row and multiple row csv files

```julia
CSV.read([MultipleRowFile, SingleRowFile), DataFrame)

```

works but reversing the order of the files

```julia
CSV.read([SingleRowFile, MultipleRowFile), DataFrame)

```

returns the following error:

```julia
ERROR: UndefVarError: `A` not defined
Stacktrace:
 [1] (::CSV.var"#3#4")(x::PooledArrays.PooledVector{String31, UInt32, Vector{UInt32}})
   @ CSV ./none:0
 [2] iterate
   @ ./generator.jl:47 [inlined]
 [3] collect(itr::Base.Generator{Vector{PooledArrays.PooledVector{String31, UInt32, Vector{UInt32}}}, CSV.var"#3#4"})
   @ Base ./array.jl:834
 [4] chaincolumns!(a::Any, b::Any)
   @ CSV ~/.julia/packages/CSV/tmZyn/src/utils.jl:240
 [5] CSV.File(sources::Vector{String}; source::Nothing, kw::@Kwargs{})
   @ CSV ~/.julia/packages/CSV/tmZyn/src/file.jl:930
 [6] File
   @ ~/.julia/packages/CSV/tmZyn/src/file.jl:901 [inlined]
 [7] read(source::Vector{String}, sink::Type; copycols::Bool, kwargs::@Kwargs{})
   @ CSV ~/.julia/packages/CSV/tmZyn/src/CSV.jl:117
 [8] read(source::Vector{String}, sink::Type)
   @ CSV ~/.julia/packages/CSV/tmZyn/src/CSV.jl:113
 [9] top-level scope
   @ REPL[154]:1

```

I made a separate post but just wondering. Thanks!

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [March 15, 2024, 2:03pm UTC](https://discourse.julialang.org/t/readtable-with-dataframe-v0-21-3/42226/5 "2024-03-15T14:03:09Z")

</div>

Please start a separate thread with your question (as you have done already, and I have answered there)
