# Finding out mwel filename

**URL:** <https://mworks.discourse.group/t/finding-out-mwel-filename/283>\
**Category:** Support\
**Created:** [January 11, 2019, 4:58pm UTC](https://mworks.discourse.group/t/finding-out-mwel-filename/283 "2019-01-11T16:58:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [January 11, 2019, 4:58pm UTC](https://mworks.discourse.group/t/finding-out-mwel-filename/283/1 "2019-01-11T16:58:07Z")

</div>

Hi Chris,

Is there a way to retrieve the name of the .mwel file that was run from its corresponding .mwk file?  
Thanks,

–  
Sujay

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [January 11, 2019, 5:21pm UTC](https://mworks.discourse.group/t/finding-out-mwel-filename/283/2 "2019-01-11T17:21:06Z")

</div>

Hi Sujay,

As we discussed offline, the name and contents of all MWEL files used in an experiment are recorded in the data file via the variable [#loadedExperiment](https://mworks.github.io/documentation/latest/reference/sysvars.html#loadedexperiment).

I’ve attached a Python script that reads `#loadedExperiment` and prints the name and contents of all experiment files. It works for both XML- and MWEL-based experiments (and is an updated version of an [older script](https://mworks.tenderapp.com/discussions/questions/764) I wrote for Evan Remington a while back). Of course, you can perform an equivalent operation in MATLAB, if you prefer.

Cheers,  
Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [January 11, 2019, 5:21pm UTC](https://mworks.discourse.group/t/finding-out-mwel-filename/283/3 "2019-01-11T17:21:06Z")

</div>

Attachment: [extract\_experiment\_files.py](https://mworks.discourse.group/uploads/short-url/vLi2I0iiNyPBh8eF0Wf8Omj0WYS.py) (1004 Bytes)

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [July 19, 2022, 9:38pm UTC](https://mworks.discourse.group/t/finding-out-mwel-filename/283/4 "2022-07-19T21:38:08Z")

</div>


