A text replace node

For me, it links back to this question

But it would be handy to have a text replace node, that can take the text of the previous node and manipulate it however need, be that via a regex and delete, or match text and replace etc.

For now you can use script code (javascript) and replace text.

Or you can try out my pull request (warning its not complete finished, but i use it myself and it works)

2 Likes

yeah i know about that .replace etc, but if you look at the thread, sometimes its not that simple for all of us.

Therefore I have developed the TextManipulation node.
It is currently far from perfect and needs a complete clean up.
Since I didn’t have much time lately and also didn’t use n8n actively (due to private reasons) a lot of things fell by the wayside.
In addition, I would like to wait with the further development, because I do not know exactly whether this node fits into n8n at all, since this already has a complexity size.
Here is a small screenshot of how it would currently look.

4 Likes

Hey @lublak

How can i get this TextManipulation node?

@igordisco currenlty the node is avaible as pull request.
It is up to the n8n team to decide if the node will be integrated into n8n.
The node would still have to be tested a bit.
If you want to have it, the easiest way would be to download the branch and start from that branch.
I also merged it with the last point of n8n.
If it is not accepted by n8n team, I will offer it as a single node via npm.

@RedPacketSec i added entities now the TextManipulation node.
A few options can be added but the basic functionality exists.

Here is a full List of my pull request for the TextManipulation Node.
If there is anything else, feel free to let me know. Generally speaking, I would consider it complete now.

From
    Text
    File (Binary)
        With decode options
    JSON
To
    Text
    File (Binary)
        With encode options
    JSON
Get Manipulated Data (use previously manipulated)
Skip Non-String
Concat
    Before
    After
Decode/Encode
    see icon-v (utf8, base64, utf16, etc...)
    with strip/add BOM
Decode/Encode Entities
    Url
    Xml
    Html
Letter Case
    Upper Case
    Lower Case
    Locale Upper Case
    Locale Lower Case
    Capitalize
    Titlecase
    Camel Case
    Kebab Case
    Snake Case
    Start Case
Replace
    Substring
    Regex
    Substring All
    Regex All
Trim
    Left
    Right
    Both
    Left as an unit
    Right as an unit
    Both as an unit
Pad
    Start
    End
Substring
    StartPosition
    With
        Complete
        Position
        Length
Repeat
    Times

Split text would also be a valuable addition to what you’ve listed @lublak:

See the following UI example from Zapier:

Welcome to the community @Tyler-Intentflow

Make sure you upvote the feature request.

1 Like

I was already considering whether to include split and join in this node.
Currently, all data is always from text to text.
Split would be from text to array and join would be from array to text.
Basically, of course, this can also be integrated here, but I am still undecided about this.
I am currently planning another node that might be more suitable for this function. Which allows different combinations of the data structures.
Currently it is rather difficult to work with nested structures. When it is ready, I will of course also make a pull request for it at n8n :slight_smile:

1 Like

Great idea.
By the way, I’m not finding the TextManipulator node in my instance.
Is it in production? :slight_smile:

Looks like it is waiting for a review so it is not currently in n8n, depending on how comfortable you are with Git you could pull the change down and run it in your instance.

2 Likes