# StringEpression

**URL:** <https://discuss.hail.is/t/stringepression/1190>\
**Category:** Hail Query & hailctl\
**Created:** [November 29, 2019, 11:12am UTC](https://discuss.hail.is/t/stringepression/1190 "2019-11-29T11:12:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Haseeb1](https://avatars.discourse-cdn.com/v4/letter/h/df705f/32.png) [@Haseeb1](https://discuss.hail.is/u/Haseeb1)\
**Post date:** [November 29, 2019, 11:12am UTC](https://discuss.hail.is/t/stringepression/1190/1 "2019-11-29T11:12:52Z")

</div>

I have exported a StringExpression array into table format but all the variables which that array contains are coming in a single column, i want to know how can i split those values into different columns because i cant use them in this fashion??

![image](https://canada1.discourse-cdn.com/flex036/uploads/hail/original/1X/6ceac110c4e34315e15284d6db1941a08f48314e.png)

In the picture locus and alleles are separated by “;” but after it i have VEP which is in StringEpression and that is what i want to use but can not.

Thanks.

---

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [November 29, 2019, 12:07pm UTC](https://discuss.hail.is/t/stringepression/1190/2 "2019-11-29T12:07:07Z")

</div>

What’s the schema of the table? `ht.describe()`?

---

<div class="post-metadata">

**Author:** ![danking](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/danking/32/43_2.png) [@danking](https://discuss.hail.is/u/danking)\
**Post date:** [November 29, 2019, 2:11pm UTC](https://discuss.hail.is/t/stringepression/1190/3 "2019-11-29T14:11:20Z")

</div>

I think you don’t want to use export. Instead of exporting an expression, try using `write` to write out the table or matrix table that the expression comes from. If you have a matrix table row expression and you don’t want to write out the genotypes you can use:

```auto
rows = mt.rows()
rows.select(... expression ...).write(...)

```

`write` stores data in a Hail-friendly format so it’s faster and preserves the data types when you `read` it. `export` generates text so it’s slower and loses data type information.

---

<div class="post-metadata">

**Author:** ![Haseeb1](https://avatars.discourse-cdn.com/v4/letter/h/df705f/32.png) [@Haseeb1](https://discuss.hail.is/u/Haseeb1)\
**Post date:** [December 16, 2019, 7:32am UTC](https://discuss.hail.is/t/stringepression/1190/4 "2019-12-16T07:32:44Z")

</div>

This is a csv file. My mt was not converting into table, thats why i just saved my mt as a csv file.

---

<div class="post-metadata">

**Author:** ![Haseeb1](https://avatars.discourse-cdn.com/v4/letter/h/df705f/32.png) [@Haseeb1](https://discuss.hail.is/u/Haseeb1)\
**Post date:** [December 16, 2019, 7:37am UTC](https://discuss.hail.is/t/stringepression/1190/5 "2019-12-16T07:37:27Z")

</div>

I tried to write mt into a table but faced the following error; [VCFParseError: invalid INFO key](https://discuss.hail.is/t/vcfparseerror-invalid-info-key/1159/2)

---

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [December 16, 2019, 12:26pm UTC](https://discuss.hail.is/t/stringepression/1190/6 "2019-12-16T12:26:57Z")

</div>

That error will occur on any usage of the matrix table – it needs to be resolved. I think the easiest thing is to preprocess your VCF to remove the problematic properties.
