# How can i draw .txt data written in meshgrid format.

**URL:** https://discourse.paraview.org/t/how-can-i-draw-txt-data-written-in-meshgrid-format/10027
**Category:** ParaView Support
**Created:** [July 17, 2022, 4:49pm UTC](https://discourse.paraview.org/t/how-can-i-draw-txt-data-written-in-meshgrid-format/10027 "2022-07-17T16:49:41Z")
**Posts on this page:** 1
**Showing post:** 3

<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: [July 19, 2022, 1:09pm UTC](https://discourse.paraview.org/t/how-can-i-draw-txt-data-written-in-meshgrid-format/10027/3 "2022-07-19T13:09:47Z")

</div>

Hello,

I was able to load it in the same way as the link below.

> [@CSV table data to 3D](https://discourse.paraview.org/t/csv-table-data-to-3d/7858/4):
>
> One way to achieve this is to use a Programmable Source. Source \> Alphabetical \> Programmable Source Fill in the Script (RequestInformation) as shown below. from paraview import util util.SetOutputWholeExtent(self, [0, 98, 0, 37, 0, 0]) Here, the values to be specified for SetOutputWholeExtent are obtained by counting the number of rows and columns from the csv file in advance. Enter the following in Script. import numpy as np path = 'data\_path/Sample.csv' a = np.loadtxt(path, delimiter=…

Now you need to modify the `Script (RequestInformation)` and `Script` in the **Programmable Source** Filter.

- `Script (RequestInformation)`

```python
from paraview import util
util.SetOutputWholeExtent(self, [0, 140, 0, 141, 0, 0])

```

- `Script`

```python
import numpy as np

path = 'your_data_path/Ux.txt'
a = np.loadtxt(path, encoding='utf-8_sig').flatten()

output.SetDimensions(141, 142, 1)
output.SetOrigin(0.0, 0.0, 0.0)
output.SetSpacing(1, 1, 1)
output.PointData.append(a, 'height')

```

 ![meshgrid_load](https://discourse.paraview.org/uploads/default/original/2X/f/f473dff7f1bdbc03896b476c3d84c5f48e098a0e.jpeg)

---

_[View the full topic](https://discourse.paraview.org/t/how-can-i-draw-txt-data-written-in-meshgrid-format/10027)._
