# VTK Reader

**URL:** https://discourse.paraview.org/t/vtk-reader/6121
**Category:** ParaView Support
**Created:** [December 24, 2020, 4:32am UTC](https://discourse.paraview.org/t/vtk-reader/6121 "2020-12-24T04:32:26Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Nimish\_Nazirkar](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nimish_nazirkar/32/5605_2.png) [@Nimish\_Nazirkar](https://discourse.paraview.org/u/Nimish_Nazirkar)
#### Post date: [December 24, 2020, 4:32am UTC](https://discourse.paraview.org/t/vtk-reader/6121/1 "2020-12-24T04:32:26Z")

</div>

Hi,  
I downloaded the 64-bit Paraview 5.9.0-RC3 from the official site.  
My software doesn’t contain a Legacy VTK file reader.  
What can be done to download the same?  
Or is there any other reader that can read .vtk files in Para view?

---

<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: [December 24, 2020, 9:12am UTC](https://discourse.paraview.org/t/vtk-reader/6121/2 "2020-12-24T09:12:50Z")

</div>

Hi Nimish,

It does contains a .vtk file reader.  
What error do you have ?

---

<div class="post-metadata">

### Author: ![Nimish\_Nazirkar](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nimish_nazirkar/32/5605_2.png) [@Nimish\_Nazirkar](https://discourse.paraview.org/u/Nimish_Nazirkar)
#### Post date: [December 24, 2020, 9:20am UTC](https://discourse.paraview.org/t/vtk-reader/6121/3 "2020-12-24T09:20:35Z")

</div>

While opening the .vtk group of files, the software is asking me which reader should I use as it couldn’t find any reader for .vtk file.

I am trying to download a .zip file of the software and installing again to see if something was missed while installing it beforehand

---

<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: [December 24, 2020, 11:55am UTC](https://discourse.paraview.org/t/vtk-reader/6121/4 "2020-12-24T11:55:31Z")

</div>

Your .vtk file is probably malformed, please share it.

---

<div class="post-metadata">

### Author: ![Nimish\_Nazirkar](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nimish_nazirkar/32/5605_2.png) [@Nimish\_Nazirkar](https://discourse.paraview.org/u/Nimish_Nazirkar)
#### Post date: [December 24, 2020, 12:27pm UTC](https://discourse.paraview.org/t/vtk-reader/6121/5 "2020-12-24T12:27:40Z")

</div>

I will attach my .vtk file here.  
Though the point being I could not see Legacy VTK Reader in the list provided by the software.  
I have a group of .vtk files and none of them is opening.

Thanks & Regards

[time\_1.vtk](https://discourse.paraview.org/uploads/short-url/3SH3WrdOMCwFrh14FO5zdlTCVpF.vtk) (236 KB)

---

<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: [December 24, 2020, 1:42pm UTC](https://discourse.paraview.org/t/vtk-reader/6121/6 "2020-12-24T13:42:32Z")

</div>

As I said, your file is malformed, here it is, corrected:

[time\_1.vtk](https://discourse.paraview.org/uploads/short-url/coWCjk7Pw5RvxOchRmtVdD388BO.vtk) (236.2 KB)

---

<div class="post-metadata">

### Author: ![Nimish\_Nazirkar](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nimish_nazirkar/32/5605_2.png) [@Nimish\_Nazirkar](https://discourse.paraview.org/u/Nimish_Nazirkar)
#### Post date: [December 24, 2020, 1:48pm UTC](https://discourse.paraview.org/t/vtk-reader/6121/7 "2020-12-24T13:48:54Z")

</div>

Thank you very much  
What can i do in order to correct all my files?

I’ll share my matlab code with you here.  
If you could, please suggest a fix in this

```
function write_vtk_grid_values(nx,ny,dx,dy,istep,data1)

format long

%-- open output file

fname = sprintf('time_%d.vtk',istep);
out = fopen(fname,'w');

nz = 1;

npoin = nx*ny*nz;
% start writing ASCII VTK file:
% header of VTK file
fprintf(out,'# vtk DataFileversion 2.0\n');
fprintf(out,'time_10.vtk\n');
fprintf(out,'ASCII\n');
fprintf(out,'DATASET STRUCTURED_GRID\n');

%--- coords of grid points:

fprintf(out,'DIMENSIONS %5d %5d%5d\n',nx,ny,nz);
fprintf(out,'POINTS %7d float\n',npoin);
for i = 1:nx
for j = 1:ny

x = (i-1)*dx;
y = (j-1)*dy;
z = 0.0;

fprintf(out, '%14.6e %14.6e%14.6e\n',x,y,z);

end
end

%--- write grid point values:

fprintf(out,'POINT_DATA %5d\n',npoin);

fprintf(out,'SCALARS CON float 1\n');

fprintf(out,'LOOKUP_TABLE default\n');
for i = 1:nx
for j = 1:ny
ii = (i-1)*nx+j;

fprintf(out,'%14.6e\n',data1(i,j));
end
end

fclose(out);
end %endfunction

```

Thanks & Regards

---

<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: [December 24, 2020, 2:34pm UTC](https://discourse.paraview.org/t/vtk-reader/6121/8 "2020-12-24T14:34:10Z")

</div>

> [@Nimish\_Nazirkar](#):
>
> `fprintf(out,'# vtk DataFileversion 2.0\n');`

Should be

```auto
fprintf(out,'# vtk DataFile Version 2.0\n');

```

---

<div class="post-metadata">

### Author: ![Nimish\_Nazirkar](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nimish_nazirkar/32/5605_2.png) [@Nimish\_Nazirkar](https://discourse.paraview.org/u/Nimish_Nazirkar)
#### Post date: [December 24, 2020, 3:00pm UTC](https://discourse.paraview.org/t/vtk-reader/6121/9 "2020-12-24T15:00:06Z")

</div>

Thank you very much for all your help sir!

Thanks & Regards
