# CSV.read not able to read properly a simple file

**URL:** <https://discourse.julialang.org/t/csv-read-not-able-to-read-properly-a-simple-file/18216>\
**Category:** General Usage\
**Created:** [December 2, 2018, 9:35am UTC](https://discourse.julialang.org/t/csv-read-not-able-to-read-properly-a-simple-file/18216 "2018-12-02T09:35:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Altaf\_Sultanji](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@Altaf\_Sultanji](https://discourse.julialang.org/u/Altaf_Sultanji)\
**Post date:** [December 2, 2018, 9:35am UTC](https://discourse.julialang.org/t/csv-read-not-able-to-read-properly-a-simple-file/18216/1 "2018-12-02T09:35:30Z")

</div>

I am trying to load a csv file with following date:  
5  
0 0  
0 0.5  
0 1  
1 1  
1 0

I am using following method:

```julia
df_data = CSV.read(filename; delim = ' ', header = false)

```

![Opt-wk4](https://global.discourse-cdn.com/julialang/original/3X/2/0/20a361c4ab1f4529cb8d0fbd07199447fb740df4.png)

The issue is that it is not loading the second column.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [December 2, 2018, 9:41am UTC](https://discourse.julialang.org/t/csv-read-not-able-to-read-properly-a-simple-file/18216/2 "2018-12-02T09:41:21Z")

</div>

In general, please [quote your code](https://discourse.julialang.org/t/psa-how-to-quote-code-with-backticks/7530).

Specifically, the issue here could be that the first row has a single cell. The quickest fix may be removing that row with a text editor, adding a cell if that makes sense, or using `skipto`, ie

```julia
CSV.read(filename; delim = ' ', header = false, skipto = 2)

```

---

<div class="post-metadata">

**Author:** ![Altaf\_Sultanji](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@Altaf\_Sultanji](https://discourse.julialang.org/u/Altaf_Sultanji)\
**Post date:** [December 2, 2018, 9:45am UTC](https://discourse.julialang.org/t/csv-read-not-able-to-read-properly-a-simple-file/18216/3 "2018-12-02T09:45:03Z")

</div>

Thanks. The “skipto = 2” works fine. Indeed it is an issue due to single cell. If I put a space after single cell it works fine. But since this is the input file on which I have no control I will have to rely on skipto option.

---

<div class="post-metadata">

**Author:** ![bennedich](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bennedich/32/4894_2.png) [@bennedich](https://discourse.julialang.org/u/bennedich)\
**Post date:** [December 2, 2018, 10:07am UTC](https://discourse.julialang.org/t/csv-read-not-able-to-read-properly-a-simple-file/18216/4 "2018-12-02T10:07:15Z")

</div>

I presume that the first line is the count of rows?

Keep in mind that `CSV.read` automatically deduces the column types by default, so the command above will result in one int column and one float column, which might not be desired. You can use the `types` argument if you know beforehand what the types are.
