# UndefVarError: readcsv not defined

**URL:** <https://discourse.julialang.org/t/undefvarerror-readcsv-not-defined/26112>\
**Category:** New to Julia\
**Tags:** csv\
**Created:** [July 7, 2019, 12:00pm UTC](https://discourse.julialang.org/t/undefvarerror-readcsv-not-defined/26112 "2019-07-07T12:00:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hopezh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hopezh/32/9220_2.png) [@hopezh](https://discourse.julialang.org/u/hopezh)\
**Post date:** [July 7, 2019, 12:00pm UTC](https://discourse.julialang.org/t/undefvarerror-readcsv-not-defined/26112/1 "2019-07-07T12:00:44Z")

</div>

I’m following Huda Nassar’s tutorial on [Julia for data science](https://www.youtube.com/watch?v=SLE0vz85Rqo&feature=youtu.be).

However, I’m unable to run the **readcsv** or **readdlm** command in the very beginning.

The error message is:

> UndefVarError: readcsv not defined
> 
> Stacktrace:  
> [1] top-level scope at In[7]:1

May I ask how to read csv file if the readcsv function is not available anymore?

 ![57%20PM](https://global.discourse-cdn.com/julialang/original/3X/7/1/71f34942efba425688d77b4052428518fd8e9df5.png)

---

<div class="post-metadata">

**Author:** ![tkoolen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkoolen/32/1603_2.png) [@tkoolen](https://discourse.julialang.org/u/tkoolen)\
**Post date:** [July 7, 2019, 12:15pm UTC](https://discourse.julialang.org/t/undefvarerror-readcsv-not-defined/26112/2 "2019-07-07T12:15:38Z")

</div>

In Julia 0.7, `readcsv(io[, T::Type]; opts...)` was deprecated in favor of `readdlm(io, ','[, T]; opts...)`. [`readdlm`](https://docs.julialang.org/en/v1/stdlib/DelimitedFiles/#DelimitedFiles.readdlm-Tuple%7BAny,AbstractChar,Type,AbstractChar%7D) is in the `DelimitedFiles` standard library, so you’ll need a `using DelimitedFiles`

---

<div class="post-metadata">

**Author:** ![quinnj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quinnj/32/11_2.png) [@quinnj](https://discourse.julialang.org/u/quinnj)\
**Post date:** [July 7, 2019, 3:22pm UTC](https://discourse.julialang.org/t/undefvarerror-readcsv-not-defined/26112/3 "2019-07-07T15:22:06Z")

</div>

@tkoolen is correct; the `DelimitedFiles` standard library exports the `readdlm` function, which provides basic delimited file reading functionality. With the CSV.jl package, you can call `CSV.read` which provides many additional features/options for reading delimited files. You can call `?CSV.read` from the repl to see documentation for the function, you can also check out the extensive [examples](https://juliadata.github.io/CSV.jl/stable/#Examples-1) section of the package documentation.

---

<div class="post-metadata">

**Author:** ![hopezh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hopezh/32/9220_2.png) [@hopezh](https://discourse.julialang.org/u/hopezh)\
**Post date:** [July 8, 2019, 12:42pm UTC](https://discourse.julialang.org/t/undefvarerror-readcsv-not-defined/26112/4 "2019-07-08T12:42:04Z")

</div>

Thank you, @tkoolen and @quinnj.

Following your advice, I read the csv file successfully as expected:

 ![09%20PM](https://global.discourse-cdn.com/julialang/original/3X/8/9/89ebe7fc00700918b544c7739103c0316d71c596.png)
