# Reading vtk file

**URL:** https://discourse.paraview.org/t/reading-vtk-file/14407
**Category:** ParaView Support
**Tags:** vtk
**Created:** [April 15, 2024, 3:23pm UTC](https://discourse.paraview.org/t/reading-vtk-file/14407 "2024-04-15T15:23:01Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![mbaghirzade](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/da6949/32.png) [@mbaghirzade](https://discourse.paraview.org/u/mbaghirzade)
#### Post date: [April 15, 2024, 3:23pm UTC](https://discourse.paraview.org/t/reading-vtk-file/14407/1 "2024-04-15T15:23:01Z")

</div>

Hello,  
I hope this message finds all well.  
I am reaching out to ask one issue regarding my vtk output files.  
When I plot the files, I get the profiles, however, in the same time I get the error message saying “Cannot read lookup table data!”. There is actually such a line in the vtk files. I have searched to find the possible reason but had no luck.  
I’d appreciate if any of you can have any suggestion on this matter.  
Please find attached sample file.  
Thank you for your time.  
Best  
MB  
[VolTs\_res\_at\_loop\_1.vtk](https://discourse.paraview.org/uploads/short-url/6RahKjJ1wUW7Xb1uKgh2VYGa0fe.vtk) (1.2 MB)

---

<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: [April 15, 2024, 4:01pm UTC](https://discourse.paraview.org/t/reading-vtk-file/14407/2 "2024-04-15T16:01:43Z")

</div>

Looks like your file is slightly malformed and VTK reports it. More investigation would be needed as to what should be fixed in your file.

That being said, ParaView would completely ignore that lookup table information, so it is safe to ignore.

How did you generate that file ?

---

<div class="post-metadata">

### Author: ![mbaghirzade](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/da6949/32.png) [@mbaghirzade](https://discourse.paraview.org/u/mbaghirzade)
#### Post date: [April 16, 2024, 3:09pm UTC](https://discourse.paraview.org/t/reading-vtk-file/14407/3 "2024-04-16T15:09:08Z")

</div>

Hello Mathieu,

Thank you for your prompt reply. I appreciate it!  
This is part of the large code.  
In one section I saw it says,  
filename = m\_prefixname + “_VolTs\_VTK_” + m\_subdName + “\_” + filesuffix + “.vtk”;

“outputfile \<\< “# vtk DataFile Version 2.0” \<\< std::endl;”

Do yo think having updated version would be better? If I don’t understand wrong, I assume vtk is an old format and it has been switched to vtu. Should I do so?

Also, do you think the attached warning can be omitted too? When its ays “Unsupported cell attribute” does it mean that some of my results are not plotted.

Thank you

 ![Screenshot 2024-04-16 at 10.03.40 AM](https://discourse.paraview.org/uploads/default/original/2X/7/7ee7ffd60bcb56b5d556cbc84320979d38718c5e.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: [April 17, 2024, 5:39am UTC](https://discourse.paraview.org/t/reading-vtk-file/14407/4 "2024-04-17T05:39:43Z")

</div>

I dont see this warning, is it from another file ?

---

<div class="post-metadata">

### Author: ![Kenichiro-Yoshimi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@Kenichiro-Yoshimi](https://discourse.paraview.org/u/Kenichiro-Yoshimi)
#### Post date: [April 17, 2024, 6:43am UTC](https://discourse.paraview.org/t/reading-vtk-file/14407/5 "2024-04-17T06:43:34Z")

</div>

It appears that the VolTs\_res\_at\_loop\_1.vtk file can be successfully loaded after implementing the following two modifications:

1. Switch lines 41921 and 41922:  
Please rearrange these lines in the file.
2. Replace float with double:  
Update any occurrences of the data type “float” to “double.”

For your convenience, I have attached the modified file.  
[VolTs\_res\_at\_loop\_1\_mod.zip](https://discourse.paraview.org/uploads/short-url/y24bbQLx44dg3EfXbsSSP4EmJfY.zip) (220.5 KB)

---

<div class="post-metadata">

### Author: ![mbaghirzade](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/da6949/32.png) [@mbaghirzade](https://discourse.paraview.org/u/mbaghirzade)
#### Post date: [April 19, 2024, 3:48am UTC](https://discourse.paraview.org/t/reading-vtk-file/14407/6 "2024-04-19T03:48:56Z")

</div>

Hello Mathieu,

I realized that I did not attach that file. Yes, that warning was from another file which I have attached.  
[VolTs\_res\_at\_loop\_0\_363.vtk](https://discourse.paraview.org/uploads/short-url/rzlyWVoFAmSdieO3zdKbRlfR6Uk.vtk) (1.0 MB)

---

<div class="post-metadata">

### Author: ![mbaghirzade](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/da6949/32.png) [@mbaghirzade](https://discourse.paraview.org/u/mbaghirzade)
#### Post date: [April 19, 2024, 3:49am UTC](https://discourse.paraview.org/t/reading-vtk-file/14407/7 "2024-04-19T03:49:44Z")

</div>

Hello Kyoshimi,

Thank you for your time and your suggestion. I will try it.

Best,  
MB
