# CSV.Rows number of columns

**URL:** <https://discourse.julialang.org/t/csv-rows-number-of-columns/69232>\
**Category:** General Usage\
**Tags:** csv\
**Created:** [October 5, 2021, 11:27am UTC](https://discourse.julialang.org/t/csv-rows-number-of-columns/69232 "2021-10-05T11:27:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Laco\_Kovac](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laco_kovac/32/20684_2.png) [@Laco\_Kovac](https://discourse.julialang.org/u/Laco_Kovac)\
**Post date:** [October 5, 2021, 11:27am UTC](https://discourse.julialang.org/t/csv-rows-number-of-columns/69232/1 "2021-10-05T11:27:56Z")

</div>

```julia
using CSV
z = UInt8[0x44, 0x61, 0x74, 0x65, 0x2c, 0x70, 0x41, 0x2c, 0x70, 0x42, 0x2c, 0x70, 0x43, 0x0d, 0x0a, 0x32, 0x30, 0x30, 0x34, 0x2d, 0x30, 0x31, 0x2d, 0x30, 0x31,
0x20, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x2c, 0x31, 0x2c, 0x31, 0x30, 0x2c, 0x31, 0x30, 0x30, 0x0d, 0x0a, 0x32, 0x30, 0x30, 0x34, 0x2d, 0x30,
0x31, 0x2d, 0x30, 0x31, 0x20, 0x30, 0x31, 0x3a, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x2c, 0x32, 0x2c, 0x32, 0x30, 0x2c, 0x32, 0x30, 0x30, 0x0d, 0x0a, 0x32, 0x30,
0x30, 0x34, 0x2d, 0x30, 0x31, 0x2d, 0x30, 0x31, 0x20, 0x30, 0x32, 0x3a, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x2c, 0x33, 0x2c, 0x33, 0x30, 0x2c, 0x33, 0x30, 0x30,
0x0d, 0x0a, 0x32, 0x30, 0x30, 0x34, 0x2d, 0x30, 0x31, 0x2d, 0x30, 0x31, 0x20, 0x30, 0x33, 0x3a, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x2c, 0x34, 0x2c, 0x34, 0x30,
0x2c, 0x34, 0x30, 0x30, 0x0d, 0x0a, 0x32, 0x30, 0x30, 0x34, 0x2d, 0x30, 0x31, 0x2d, 0x30, 0x31, 0x20, 0x30, 0x34, 0x3a, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x2c,
0x35, 0x2c, 0x35, 0x30, 0x2c, 0x35, 0x30, 0x30, 0x0d, 0x0a, 0x32, 0x30, 0x30, 0x34, 0x2d, 0x30, 0x31, 0x2d, 0x30, 0x31, 0x20, 0x30, 0x35, 0x3a, 0x30, 0x30,
0x3a, 0x30, 0x30, 0x2c, 0x36, 0x2c, 0x36, 0x30, 0x2c, 0x36, 0x30, 0x30, 0x0d, 0x0a, 0x32, 0x30, 0x30, 0x34, 0x2d, 0x30, 0x31, 0x2d, 0x30, 0x31, 0x20, 0x30,
0x36, 0x3a, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x2c, 0x37, 0x2c, 0x37, 0x30, 0x2c, 0x37, 0x30, 0x30]
s1 = ","
s2 = "."
csvItr = CSV.Rows(z,
        header = 1,
        delim = s1[1],
        decimal = s2[1],
        skipto = 2,
        footerskip = 0
      )
n = csvItr.cols

```

The code above throws  
ERROR: type Rows has no field cols  
in the CSV version 0.9.5 and 0.9.6, but if I go back to 0.8.5 everything works fine.

Is this a bug in CSV package, or there is a new way to determine number of columns in the latest version(s) of CSV?

Thank you,

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [October 5, 2021, 9:07pm UTC](https://discourse.julialang.org/t/csv-rows-number-of-columns/69232/2 "2021-10-05T21:07:56Z")

</div>

You know better your problem and data, but is there something else you could use from the new fields of `csvItr`?

```julia
julia> csvItr.
buf ctx len maxwarnings numwarnings tempfile
columnmap datapos limit name options values
columns datarow lookup names reusebuffer

```

For instance:

```julia
julia> length(csvItr.columnmap)
4

```
