# Read headed but empty CSV table

**URL:** https://discourse.paraview.org/t/read-headed-but-empty-csv-table/16310
**Category:** Feature Requests
**Created:** [March 12, 2025, 12:31pm UTC](https://discourse.paraview.org/t/read-headed-but-empty-csv-table/16310 "2025-03-12T12:31:40Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Roman](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/r/ed8c4c/32.png) [@Roman](https://discourse.paraview.org/u/Roman)
#### Post date: [March 12, 2025, 12:31pm UTC](https://discourse.paraview.org/t/read-headed-but-empty-csv-table/16310/1 "2025-03-12T12:31:40Z")

</div>

The current CSV reader seems to have a limitation. If the table is empty (i.e., consists of just the header with columns names), no table is generated in ParaView. It would be great if the CSV reader created an empty table with header in this case. It seems that this should be possible if a header is provided.

My use case is the following: I read a point cloud from a CSV file series containing x,y,z columns with a header, and then I apply the TableToPoints filter to it. Usually, the first file is an empty table, because particles are produced over time, starting from none. This then produces an error “Failed to locate the columns to use for the point coordinates” in vtkExecutive.cxx, line 730.

 ![error](https://discourse.paraview.org/uploads/default/original/3X/6/f/6f146b1ae8d4ae8c4860c5c06b587470d305fd94.png)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 12, 2025, 12:32pm UTC](https://discourse.paraview.org/t/read-headed-but-empty-csv-table/16310/2 "2025-03-12T12:32:11Z")

</div>

I agree and that should be pretty simple.

---

<div class="post-metadata">

### Author: ![Roman](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/r/ed8c4c/32.png) [@Roman](https://discourse.paraview.org/u/Roman)
#### Post date: [March 17, 2025, 11:42am UTC](https://discourse.paraview.org/t/read-headed-but-empty-csv-table/16310/3 "2025-03-17T11:42:14Z")

</div>

Cool, thanks for looking into this! Would love to see this working soon.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 18, 2025, 8:28am UTC](https://discourse.paraview.org/t/read-headed-but-empty-csv-table/16310/4 "2025-03-18T08:28:13Z")

</div>

> Would love to see this working soon.

Don’t hesitate to contribute to this, time or funding 🙂

> [@How are features and bug fixes incorporated into ParaView?](https://discourse.paraview.org/t/how-are-features-and-bug-fixes-incorporated-into-paraview/4735):
>
> As with all open source projects, adding features and fixing bugs takes developer effort. That effort may originate from volunteer community contributors, or through paid professional services offered by companies like [Kitware](https://www.kitware.com). Features and bug fixes are prioritized by the needs of contributing community members and by professional services customers. Note that contributions are vetted by a rigorous community review and testing process; therefore it is recommended that significant changes are d…

---

<div class="post-metadata">

### Author: ![Roman](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/r/ed8c4c/32.png) [@Roman](https://discourse.paraview.org/u/Roman)
#### Post date: [March 25, 2025, 9:41am UTC](https://discourse.paraview.org/t/read-headed-but-empty-csv-table/16310/5 "2025-03-25T09:41:58Z")

</div>

I wish I knew how to contribute the code change for this. I’ve spent half a day trying to locate the point in the VTK codebase that would need to be modified, but failed …

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 25, 2025, 9:49am UTC](https://discourse.paraview.org/t/read-headed-but-empty-csv-table/16310/6 "2025-03-25T09:49:38Z")

</div>

`VTK/Filters/General/vtkTableToPolyData.cxx`

However I see that there is already a check for empty table:

```auto
  if (input->GetNumberOfRows() == 0)
  {
    // empty input.
    return 1;
  }

```

Can you share your empty data and step to reproduce the error ?

---

<div class="post-metadata">

### Author: ![Roman](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/r/ed8c4c/32.png) [@Roman](https://discourse.paraview.org/u/Roman)
#### Post date: [March 25, 2025, 11:03am UTC](https://discourse.paraview.org/t/read-headed-but-empty-csv-table/16310/7 "2025-03-25T11:03:37Z")

</div>

Thanks so much, Mathieu. I’m attaching two CSV files, the first one empty, the second one containing 2 points, both having the same header x,y,z. Steps to reproduce in ParaView 5.13.2:

1. Open the CSV file series. SpreadSheetView1 opens up but shows nothing. TableToPoints filter is grayed out.
2. Jump from Time 0 to Time 1. TableToPoints becomes available, but SpreadSheetView1 is still empty.
3. Apply the TableToPoints filter. SpreadSheetView1 shows the two points.
4. Jump back to Time 0. SpreadSheetView1 shows nothing.
5. Remove TableToPoints filter.
6. Apply the TableToPoints filter. Despite being at Time 0, it is available.
7. Jump to Time 1 → “Failed to locate the columns to use for the point coordinates”, “ERROR: In vtkExecutive.cxx,line 730”

[particles0.csv](https://discourse.paraview.org/uploads/short-url/h1wUi1QaVkVpXj77Lks5RNJEW7A.csv) (6 Bytes)  
[particles1.csv](https://discourse.paraview.org/uploads/short-url/3zD3eviPoPU9a3REFkqHZdALjAG.csv) (60 Bytes)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 25, 2025, 12:22pm UTC](https://discourse.paraview.org/t/read-headed-but-empty-csv-table/16310/8 "2025-03-25T12:22:40Z")

</div>

Looks like you found a bug, deleting the TableToPoints should not delete the output of the CSV reader. please open an issue: [https://gitlab.kitware.com/paraview/paraview/-/issues](https://gitlab.kitware.com/paraview/paraview/-/issues)

---

<div class="post-metadata">

### Author: ![Roman](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/r/ed8c4c/32.png) [@Roman](https://discourse.paraview.org/u/Roman)
#### Post date: [March 25, 2025, 1:27pm UTC](https://discourse.paraview.org/t/read-headed-but-empty-csv-table/16310/9 "2025-03-25T13:27:14Z")

</div>

Done: [https://gitlab.kitware.com/paraview/paraview/-/issues/22923](https://gitlab.kitware.com/paraview/paraview/-/issues/22923)
