# Replace a variable when LoadState()

**URL:** https://discourse.paraview.org/t/replace-a-variable-when-loadstate/12921
**Category:** ParaView Support
**Tags:** python
**Created:** [September 25, 2023, 1:59pm UTC](https://discourse.paraview.org/t/replace-a-variable-when-loadstate/12921 "2023-09-25T13:59:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![madmoonman](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/ee7513/32.png) [@madmoonman](https://discourse.paraview.org/u/madmoonman)
#### Post date: [September 25, 2023, 1:59pm UTC](https://discourse.paraview.org/t/replace-a-variable-when-loadstate/12921/1 "2023-09-25T13:59:35Z")

</div>

Hello experts!  
I am using LoadState from paraview.simple to load a state file. We can readily provide a data directory there to replace the data in the file with a new one. Now I am also looking for a way to replace a specifically used variable the same way.  
Lets say I have a dataset with two fields, one is called carbon.concentration, the other nitrogen.concentration. It is used in the state e.g. in a calculator function. I want to create the images in this state once for carbon (the state is build with this) and also for nitrogen. Is there a built-in search/replace mechanism that I can use to make this work?  
The LoadState() function can take several arguments but I have not yet found a complete list anywhere, but I thought this is a possible approach.  
Thanks!

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [September 25, 2023, 2:13pm UTC](https://discourse.paraview.org/t/replace-a-variable-when-loadstate/12921/2 "2023-09-25T14:13:46Z")

</div>

> [@madmoonman](#):
>
> Is there a built-in search/replace mechanism that I can use to make this work?

There is not. You’ll need to use an external editing tool to do the find/replace.

---

<div class="post-metadata">

### Author: ![madmoonman](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/ee7513/32.png) [@madmoonman](https://discourse.paraview.org/u/madmoonman)
#### Post date: [September 26, 2023, 6:18am UTC](https://discourse.paraview.org/t/replace-a-variable-when-loadstate/12921/3 "2023-09-26T06:18:51Z")

</div>

Alright, I will find another way then.  
Thanks for the swift clarification.
