Hello,

There are some tools in the group 'Text Manipulation' that do this sort of manipulation directly. Combined, many basic "unix" functions can be performed. Combine them to create custom tools using Workflows - even place them in your tool menu for seamless access.

To move from file A to file B, use tools such as these as a rough example:
  * Convert delimiters to TAB (convert all "_" to tabs)
  * Add column to an existing dataset (could include a single "_" char, to be merged later)
  * Cut columns from a table (can be used to rearrange and leave behind unwanted columns)
  * Merge Columns together (merge the new "_" back where you want it)

Compute and Select have some character filters on them for security reasons. If you were running your own Galaxy and it wasn't public, these could be removed of course. Also, a tool from the Tool Shed such as the 'Tool factory' could be used to turn pretty much any custom unix/shell (or other!) script that acts on text data into a full fledged, single tool - the tool that creates tools! That new tool could even be for a publicly hosted server use if you wanted to do that (I'd recommend a security test first though, as with any new tool!). And don't leave Tool Factory active on a public server - bad things could happen.

I am positive others have come up with many more solutions in all sorts of flavors. Discussions like this are good for the galaxy-dev@bx.psu.edu mailing list if you are interested in interacting with the development community. More about the list is here, about joining, posting, and following along:
http://wiki.galaxyproject.org/Support#Mailing_Lists

Thanks!
Jen
Galaxy team

On 8/29/13 9:38 AM, 师云 wrote:
Hello everyone,
 
I found regular expression could be available in the tool (filter and sort) ->Filter.  I wonder whether it could be the same in the tool (Text Manipulation) ->Compute. I have checked that the fuction "len(c4.split('_'))" would return error. So, could anyone tell me if it was possible like this?
 
The file A:
chr1    10    40    NM_1234_exon_1
chr2    50    70    NM_1234_exon_2
 
Change the file A to the file B such as:
chr1    10    40    NM_1234
chr2    50    70    NM_1234
 
 
May it is useless in the example. But the way could solve problems I met.


___________________________________________________________
The Galaxy User list should be used for the discussion of
Galaxy analysis and other features on the public server
at usegalaxy.org.  Please keep all replies on the list by
using "reply all" in your mail client.  For discussion of
local Galaxy instances and the Galaxy source code, please
use the Galaxy Development list:

  http://lists.bx.psu.edu/listinfo/galaxy-dev

To manage your subscriptions to this and other Galaxy lists,
please use the interface at:

  http://lists.bx.psu.edu/

To search Galaxy mailing lists use the unified search at:

  http://galaxyproject.org/search/mailinglists/

-- 
Jennifer Hillman-Jackson
http://galaxyproject.org