# Create a new column with an expression

**URL:** <https://help.galaxyproject.org/t/create-a-new-column-with-an-expression/18631>\
**Category:** Uncategorized\
**Tags:** text-manipulation, add\_a\_column1\
**Created:** [November 12, 2026, 3:09pm UTC](https://help.galaxyproject.org/t/create-a-new-column-with-an-expression/18631 "2026-11-12T15:09:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![microfuge](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/microfuge/32/3587_2.png) [@microfuge](https://help.galaxyproject.org/u/microfuge)\
**Post date:** [November 12, 2026, 3:09pm UTC](https://help.galaxyproject.org/t/create-a-new-column-with-an-expression/18631/1 "2026-11-12T15:09:18Z")

</div>

I have tabular data and I want to add an extra column which is some operations over existing columns. E.g `str(c2) + “__” + str(c3)` . I don’t want awk as the step for new users.

I would be grateful for a tool which can do this without multiple steps.

---

<div class="post-metadata">

**Author:** ![jennaj](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/jennaj/32/27_2.png) [@jennaj](https://help.galaxyproject.org/u/jennaj)\
**Post date:** [November 12, 2026, 9:55pm UTC](https://help.galaxyproject.org/t/create-a-new-column-with-an-expression/18631/2 "2026-11-12T21:55:30Z")

</div>

Hi @microfuge

I’m guessing that you have already tried with the **Compute on rows** tool but are getting an error with `Invalid expression:` at the start, yes?

The issue is that the underscore character cannot be passed directly as it isn’t a whitelisted character that passes through the wrapper’s QA sanitation.

> <https://github.com/galaxyproject/tools-iuc/blob/1177eb96d31e74f99181c88d841bdc682e501382/tools/column_maker/column_maker.py#L219>

#### Syntax

Using the Unicode value instead can work through the Python interpreter.

- [Unicode Lookup: convert special characters](https://unicodelookup.com/#low%20line/1)

Specifically for your use case, this fails

> c2 + “\_\_” + c3

Instead, try using this

> c2 + chr(95) + c3  
> c2 + chr(95) + chr(95) + c3

Please give this a try and let us know what happens! 🙂

#### Example details

- [https://usegalaxy.org/u/jen-galaxyproject/h/demo-writing-underscores-with-compute-on-rows](https://usegalaxy.org/u/jen-galaxyproject/h/demo-writing-underscores-with-compute-on-rows)
- **Compute** on rows ([🔗](https://usegalaxy.org/?tool_id=toolshed.g2.bx.psu.edu/repos/devteam/column_maker/Add_a_column1/2.1+galaxy0) at [UseGalaxy.org](http://UseGalaxy.org))

 ![demo writing underscores with compute on rows](https://us1.discourse-cdn.com/flex020/uploads/galaxy/original/2X/a/a4001429c1651bf1a43895edac02a4cb6ade7106.png)

---

<div class="post-metadata">

**Author:** ![microfuge](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/microfuge/32/3587_2.png) [@microfuge](https://help.galaxyproject.org/u/microfuge)\
**Post date:** [November 13, 2026, 9:42am UTC](https://help.galaxyproject.org/t/create-a-new-column-with-an-expression/18631/3 "2026-11-13T09:42:17Z")

</div>

Thanks @jennaj . That worked. Although for new users this solution is a bit less straightforward. An editable spreadsheet would be great in Galaxy :).

---

<div class="post-metadata">

**Author:** ![jennaj](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/jennaj/32/27_2.png) [@jennaj](https://help.galaxyproject.org/u/jennaj)\
**Post date:** [November 13, 2026, 8:32pm UTC](https://help.galaxyproject.org/t/create-a-new-column-with-an-expression/18631/4 "2026-11-13T20:32:17Z")

</div>

Great, glad that helped!

For editing files directly, have you seen the **Editor** tool under **Visualizations**?

⚠ This is very basic editing function and error prone but also really useful!

> [@vcf file direct editing](https://help.galaxyproject.org/t/vcf-file-direct-editing/13976/3):
>
> And, Galaxy also has a regular text editor – how well that would work depends on how large your file is – and it would be very easy to introduce a problem! But you can experiment.
> 
> - Screenshot of how to find the text editor. Click on the [visualize icon](https://training.galaxyproject.org/training-material/faqs/galaxy/datasets_icons.html) within an expanded dataset, then search for “editor” in the listing.

The process goes something like this

1. Expand the target dataset
2. 📊 [Visualize icon](https://galaxyproject.github.io/training-material/faqs/galaxy/datasets_icons.html)
3. Search for the **Editor**
4. Type in new content into the file
5. Click on **export** \*
6. The modified output is written as a **new** distinct dataset in the history
7. Repeat as needed!
8. Double check with **Tabulator** and consider using **Convert delimiters to TAB** after

\ ***export** is really pale (on purpose!) unless hovered over, so I’ll share a screenshot for where to look!

 ![visualize-editor-1](https://us1.discourse-cdn.com/flex020/uploads/galaxy/original/2X/4/46e7097aba9544876ca994d24168fc7b23988a28.png)  
 ![visualize-editor-2](https://us1.discourse-cdn.com/flex020/uploads/galaxy/original/2X/5/50e11737736550673226a2a1946c8388f0399742.png)  
 ![visualize-editor-3](https://us1.discourse-cdn.com/flex020/uploads/galaxy/original/2X/8/8688f694b5e70104d748662fa321341324863d85.png)  
 ![visualize-editor-4](https://us1.discourse-cdn.com/flex020/uploads/galaxy/original/2X/2/246ccdea81a7fe56d4379cb35b163a2eb0aaab78.png)
