# Paraview reading Legacy VTK File

**URL:** https://discourse.paraview.org/t/paraview-reading-legacy-vtk-file/2188
**Category:** ParaView Support
**Tags:** vtk
**Created:** [July 9, 2019, 6:13pm UTC](https://discourse.paraview.org/t/paraview-reading-legacy-vtk-file/2188 "2019-07-09T18:13:57Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Raychel\_Bahnick](https://discourse.paraview.org/user_avatar/discourse.paraview.org/raychel_bahnick/32/1689_2.png) [@Raychel\_Bahnick](https://discourse.paraview.org/u/Raychel_Bahnick)
#### Post date: [July 9, 2019, 6:13pm UTC](https://discourse.paraview.org/t/paraview-reading-legacy-vtk-file/2188/1 "2019-07-09T18:13:57Z")

</div>

Hi,  
I am using Paraview to map a set of x,y,z points. The data is in a .vtr file in the format of vtk legacy file in rectilinear grid. I have attached the file to this email. When I open the .vtr file in Paraview 4.1.0 the reader option ‘Legacy VTK files’ is not an option. How to make the file open as a legacy vtk file if the reader is not an option to open it with?

---

<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: [July 10, 2019, 6:27am UTC](https://discourse.paraview.org/t/paraview-reading-legacy-vtk-file/2188/2 "2019-07-10T06:27:56Z")

</div>

Welcome !

.vtr file are not the legacy .vtk format.  
Please read the following : [https://vtk.org/wp-content/uploads/2015/04/file-formats.pdf](https://vtk.org/wp-content/uploads/2015/04/file-formats.pdf)

You are supposed to read .vtr files using the “VTK Rectilinearg Grid Files” reader.

---

<div class="post-metadata">

### Author: ![Raychel\_Bahnick](https://discourse.paraview.org/user_avatar/discourse.paraview.org/raychel_bahnick/32/1689_2.png) [@Raychel\_Bahnick](https://discourse.paraview.org/u/Raychel_Bahnick)
#### Post date: [July 10, 2019, 1:07pm UTC](https://discourse.paraview.org/t/paraview-reading-legacy-vtk-file/2188/3 "2019-07-10T13:07:14Z")

</div>

When I save my .vtr file that is in Notepad and is formatted for .vtk as a .vtk file the ‘Legacy VTK files’ reader is still not an option when I try to open it in Paraview. Do you have a suggestion for how I change my formatting? My file is pasted below as reference. I am just interested in being able to open my file and then contour the data once it is open in Paraview.

#vtk Datafile Version 3.0  
Non-uniform Rectilinear - Rectilinear Grid  
ASCII  
DATASET RECTILINEAR\_GRID  
DIMENSIONS 2 23 1  
X\_COORDINATES 2 float  
4850.0 4900.0  
Y\_COORDINATES 23 float  
600.0 650.0 700.0 750.0 800.0 850.0 900.0 950.0 1000.0 1050.0 1100.0 1150.0 1200.0 1250.0 1300.0 1350.0 1400.0 1450.0 1500.0 1550.0 1600.0 1650.0 1700.0  
Z\_COORDINATES 1 float  
378.0

---

<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: [July 10, 2019, 1:09pm UTC](https://discourse.paraview.org/t/paraview-reading-legacy-vtk-file/2188/4 "2019-07-10T13:09:23Z")

</div>

this is not a .vtr file. This is a Rectilinear Grid in a VTK Legacy Format. Save as a .vtk file.

(This format is legacy and should not be used when possible)

---

<div class="post-metadata">

### Author: ![Raychel\_Bahnick](https://discourse.paraview.org/user_avatar/discourse.paraview.org/raychel_bahnick/32/1689_2.png) [@Raychel\_Bahnick](https://discourse.paraview.org/u/Raychel_Bahnick)
#### Post date: [July 10, 2019, 2:02pm UTC](https://discourse.paraview.org/t/paraview-reading-legacy-vtk-file/2188/5 "2019-07-10T14:02:52Z")

</div>

So would you suggest reformatting it into the .vtr file? Can I reformat it in a program like Notepad? Would my file now be in XML format?

---

<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: [July 10, 2019, 2:04pm UTC](https://discourse.paraview.org/t/paraview-reading-legacy-vtk-file/2188/6 "2019-07-10T14:04:20Z")

</div>

no. In your case, just rename to .vtk.

---

<div class="post-metadata">

### Author: ![Raychel\_Bahnick](https://discourse.paraview.org/user_avatar/discourse.paraview.org/raychel_bahnick/32/1689_2.png) [@Raychel\_Bahnick](https://discourse.paraview.org/u/Raychel_Bahnick)
#### Post date: [July 10, 2019, 2:34pm UTC](https://discourse.paraview.org/t/paraview-reading-legacy-vtk-file/2188/7 "2019-07-10T14:34:06Z")

</div>

Thank you. When I enter my data into the .vtk file, each x value has the same 23 y values. Should I repeat the 23 y values under the y coordinates so that there would 46 y values (23 for for each of the 2 x values)? Or does Paraview only need the 23 values inputted once?

---

<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: [July 10, 2019, 2:43pm UTC](https://discourse.paraview.org/t/paraview-reading-legacy-vtk-file/2188/8 "2019-07-10T14:43:03Z")

</div>

Here is a correctly formatted rectilinear grid in the .vtk legacy format:

```
# vtk DataFile Version 4.2
vtk output
ASCII
DATASET RECTILINEAR_GRID
DIMENSIONS 2 23 1
X_COORDINATES 2 double
-7.5 -7.3906202316 
Y_COORDINATES 23 double
-3 -2.90625 -2.8125 -2.71875 -2.625 -2.53125 -2.4375 -2.34375 -2.25 
-2.15625 -2.0625 -1.96875 -1.875 -1.78125 -1.6875 -1.59375 -1.5 -1.40625 
-1.3125 -1.21875 -1.125 -1.03125 -0.9375 
Z_COORDINATES 1 double
-3
```

---

<div class="post-metadata">

### Author: ![Raychel\_Bahnick](https://discourse.paraview.org/user_avatar/discourse.paraview.org/raychel_bahnick/32/1689_2.png) [@Raychel\_Bahnick](https://discourse.paraview.org/u/Raychel_Bahnick)
#### Post date: [July 10, 2019, 3:48pm UTC](https://discourse.paraview.org/t/paraview-reading-legacy-vtk-file/2188/9 "2019-07-10T15:48:49Z")

</div>

That is very helpful. If I had 5 x coordinates, would I still use ‘double’? Also, if I had another value of x velocity that I wanted Paraview to contour based on, how would I include that in my VTK file?

---

<div class="post-metadata">

### Author: ![Arghavanizad](https://discourse.paraview.org/user_avatar/discourse.paraview.org/arghavanizad/32/1514_2.png) [@Arghavanizad](https://discourse.paraview.org/u/Arghavanizad)
#### Post date: [June 16, 2020, 10:06am UTC](https://discourse.paraview.org/t/paraview-reading-legacy-vtk-file/2188/10 "2020-06-16T10:06:46Z")

</div>

Hi everyone,  
I have two vtk files(velocity and pressure of surface ) in my postprocessing folder and I want to visualize them in paraview but I don’t know which specified tools for each of those file should use for a report. it would be helpful if you could help me.

kind regards,  
Arghavan

---

<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: [June 16, 2020, 10:21am UTC](https://discourse.paraview.org/t/paraview-reading-legacy-vtk-file/2188/11 "2020-06-16T10:21:42Z")

</div>

Please open your own topic.

---

<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: [June 16, 2020, 10:21am UTC](https://discourse.paraview.org/t/paraview-reading-legacy-vtk-file/2188/12 "2020-06-16T10:21:45Z")

</div>


