# Method Error: Cannot read CSV

**URL:** <https://discourse.julialang.org/t/method-error-cannot-read-csv/54782>\
**Category:** New to Julia\
**Tags:** question, csv\
**Created:** [February 7, 2021, 11:27am UTC](https://discourse.julialang.org/t/method-error-cannot-read-csv/54782 "2021-02-07T11:27:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![billingsham](https://avatars.discourse-cdn.com/v4/letter/b/7cd45c/32.png) [@billingsham](https://discourse.julialang.org/u/billingsham)\
**Post date:** [February 7, 2021, 11:27am UTC](https://discourse.julialang.org/t/method-error-cannot-read-csv/54782/1 "2021-02-07T11:27:12Z")

</div>

I am very new to Julia and would appreciate some help with the following. I am trying to read a CSV file into my programme. When I open the CSV Excel, its a 199x7 matrix of numbers. I am using the following code to create a variable, Xrel:

```julia
Xrel = CSV.read(joinpath(data_path,"Xrel.csv"), header=false)

```

But when I try to do this, Julia produces:

“MethodError: Cannot ‘convert’ an object of type Bool to an object of type String.”

It seems obvious to me that the data type is not boolean.

I’ve checked my paths and opened the CSV without a problem in R - it’s only in Julia that I am having an issue.

I am confused as to why Julia is saying that my data is Boolean when its a matrix of numbers? How can I resolve this to read in my CSV file?

Thanks!

---

<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:** [February 7, 2021, 12:27pm UTC](https://discourse.julialang.org/t/method-error-cannot-read-csv/54782/2 "2021-02-07T12:27:30Z")

</div>

Welcome to this fine community, @billingsham !

Which version are you using, can you post:

```julia
julia> versioninfo()
Julia Version 1.5.3
Commit 788b2c77c1 (2020-11-09 13:37 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: AMD Ryzen 9 3900X 12-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, znver2)

```

and

```julia
(@v1.5) pkg> st
Status `C:\Users\oheil\.julia\environments\v1.5\Project.toml`
  ...
  [336ed68f] CSV v0.8.3
  ...

```

There has been similar questions here with CSV and I suspect that people are trying outdated examples from some websites. The CSV API has changed quite a bit.

---

<div class="post-metadata">

**Author:** ![billingsham](https://avatars.discourse-cdn.com/v4/letter/b/7cd45c/32.png) [@billingsham](https://discourse.julialang.org/u/billingsham)\
**Post date:** [February 7, 2021, 12:55pm UTC](https://discourse.julialang.org/t/method-error-cannot-read-csv/54782/3 "2021-02-07T12:55:16Z")

</div>

Hey! Thanks for your response.

I`m running:

> Julia Version 1.5.3  
> Commit 788b2c77c1 (2020-11-09 13:37 UTC)  
> Platform Info:  
> OS: macOS (x86\_64-apple-darwin18.7.0)  
> CPU: Intel(R) Core™ i5-5250U CP  
> U @ 1.60GHz  
> WORD\_SIZE: 64  
> LIBM: libopenlibm  
> LLVM: libLLVM-9.0.1 (ORCJIT, broadwell)  
> Environment:  
> JULIA\_NUM\_THREADS = 2

and

> Status `~/Library/Mobile Documents/com~apple~CloudDocs/Academics/Postgraduate/Year 2/Thesis/Data/Replication files for Altavila 2018/code/jcode/Project.toml`  
> [336ed68f] CSV v0.5.2

I’ve seen a lot of discussion regarding CSVs, but nothing that might be of help.  
Any clues?

---

<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:** [February 7, 2021, 1:32pm UTC](https://discourse.julialang.org/t/method-error-cannot-read-csv/54782/5 "2021-02-07T13:32:05Z")

</div>

Can you try:

```julia
Xrel = CSV.File(joinpath(data_path,"Xrel.csv"); header = false)

```

(EDIT: false instead of 0)

---

<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:** [February 7, 2021, 2:18pm UTC](https://discourse.julialang.org/t/method-error-cannot-read-csv/54782/6 "2021-02-07T14:18:25Z")

</div>

Your version of CSV is quite old, try to `] add CSV@0.8`
