# How to read the given mesh data in vtk file and write it into obj file format

**URL:** https://discourse.vtk.org/t/how-to-read-the-given-mesh-data-in-vtk-file-and-write-it-into-obj-file-format/8602
**Category:** Support
**Created:** [May 26, 2022, 4:15am UTC](https://discourse.vtk.org/t/how-to-read-the-given-mesh-data-in-vtk-file-and-write-it-into-obj-file-format/8602 "2022-05-26T04:15:32Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![KALEEMULLAHJANKHAN](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/k/bc8723/32.png) [@KALEEMULLAHJANKHAN](https://discourse.vtk.org/u/KALEEMULLAHJANKHAN)
#### Post date: [May 26, 2022, 4:15am UTC](https://discourse.vtk.org/t/how-to-read-the-given-mesh-data-in-vtk-file-and-write-it-into-obj-file-format/8602/1 "2022-05-26T04:15:32Z")

</div>

Hello Team,  
I have data in mesh vtk file as given below, How can I read and convert it to obj file format. I am just copying some part of the data for convenience. Thanks in advance  
CELLS 20 70  
1 0  
1 1  
1 2  
1 3  
1 4  
2 2 3  
2 2 1088  
2 1088 4  
2 3 4  
2 5 2  
3 891 1348 890  
3 890 1349 891  
3 890 1340 1076  
3 1076 1349 890  
3 890 1348 1340  
4 1529 1520 1525 2411  
4 882 884 2072 996  
4 891 892 1347 1350  
4 250 249 265 1233  
4 1594 1596 1595 2408

---

<div class="post-metadata">

### Author: ![Christos\_Tsolakis](https://discourse.vtk.org/user_avatar/discourse.vtk.org/christos_tsolakis/32/2076_2.png) [@Christos\_Tsolakis](https://discourse.vtk.org/u/Christos_Tsolakis)
#### Post date: [May 26, 2022, 1:10pm UTC](https://discourse.vtk.org/t/how-to-read-the-given-mesh-data-in-vtk-file-and-write-it-into-obj-file-format/8602/2 "2022-05-26T13:10:33Z")

</div>

Check this example [https://kitware.github.io/vtk-examples/site/Cxx/IO/ConvertFile](https://kitware.github.io/vtk-examples/site/Cxx/IO/ConvertFile) and try replacing `vtkXMLPolyDataReader` with `vtkPolyDataReader` and `vtkPLYWriter` with `vtkOBJWriter`
