Replacing first occurence of character with something else

Hey guys,

I have a bunch of files with TITLE fields like this: 123 cute kittens

I would like to make them look like this: 123 - cute kittens

I tried to play with replace and guess values but it either changes all spaces or changes nothing - because I have no idea what I'm doing :smiley:

So, if any of you experts can share a help i'd appreciate it :slight_smile:

If the 123 is always a number, then you could try an action of the type "Replace with regular expression for TITLE:
Search string: (\d+)
Replace string: $1 -

Hello,

actually it's a mix of numbers and letters like this 1m01b, and that is not always the same but is always made of mix of letters and numbers with space at the end, thats why i thought of focusing on first occurance of space (if that is possible)...

$regexp(%title,(.*?)( .*) ,$1 -$2)
(this should work in an action of the type "FOrmat value" as format string)

It's working, but now the last two words get glued together. Like before there was a space between them, but now there isn't..

I think you need a space right before the last bracket (for some reason this did not translate into the post when I copied and pasted it ...)
$regexp(%title%,(.*?)( .*) ,$1 -$2_)
the _ indicating the space character

Examples:

$regexp('123 abc def','(.+?) (.+)','$1 - $2')
==> '123 - abc def'

$regexp('abc def','(.+?) (.+)','$1 - $2')
==> 'abc - def'

$regexp('abc','(.+?) (.+)','$1 - $2')
==> 'abc'

DD.20170206.1538.CET

Guys thank you so much, it's working flawlessly! What a great forum!