# delete unnecessary characters in data

**URL:** <https://forum.knime.com/t/delete-unnecessary-characters-in-data/36197>\
**Category:** KNIME Analytics Platform\
**Created:** [September 19, 2021, 4:53pm UTC](https://forum.knime.com/t/delete-unnecessary-characters-in-data/36197 "2021-09-19T16:53:46Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![umutcankurt](https://forum-cdn.knime.com/user_avatar/forum.knime.com/umutcankurt/32/70644_2.png) [@umutcankurt](https://forum.knime.com/u/umutcankurt)\
**Post date:** [September 19, 2021, 4:53pm UTC](https://forum.knime.com/t/delete-unnecessary-characters-in-data/36197/1 "2021-09-19T16:53:46Z")

</div>

Hi;  
I want to delete unnecessary characters in the data, I tried several methods, but it deletes the words after the character or breaks the character and after. Exactly what I want is to delete the special characters in the picture before all the words are lost. How can I do it ?

![image](https://forum-cdn.knime.com/uploads/default/original/3X/f/d/fd0db78e2f686d3a144b7c450871ff549eee01bd.png)

---

<div class="post-metadata">

**Author:** ![aworker](https://forum-cdn.knime.com/user_avatar/forum.knime.com/aworker/32/36421_2.png) [@aworker](https://forum.knime.com/u/aworker)\
**Post date:** [September 19, 2021, 5:23pm UTC](https://forum.knime.com/t/delete-unnecessary-characters-in-data/36197/2 "2021-09-19T17:23:05Z")

</div>

Hi @umutcankurt

I guess you want to remove all the possible occurrences of “`\.\.\...`”? Not only just those that were highlighted in red.

Could you please copy and paste this piece of data as text (instead of a screen snapshot) ? I’ll be glad to have a go at it and provide a possible solution.

Best

Ael

---

<div class="post-metadata">

**Author:** ![umutcankurt](https://forum-cdn.knime.com/user_avatar/forum.knime.com/umutcankurt/32/70644_2.png) [@umutcankurt](https://forum.knime.com/u/umutcankurt)\
**Post date:** [September 19, 2021, 6:31pm UTC](https://forum.knime.com/t/delete-unnecessary-characters-in-data/36197/3 "2021-09-19T18:31:24Z")

</div>

Hi @aworker  
Thanks for the answer, I want to remove the characters. Words that come before and after characters should not be lost.  
example;  
. Gemeente Oostkamp-PPP05R… Herinrichting Moerbrugsestraa…

Edit\*\*  
. Gemeente Oostkamp-PPP05R Herinrichting Moerbrugsestraa

![image](https://forum-cdn.knime.com/uploads/default/original/3X/a/e/ae19289ce1bfa04f5710a001d94405c27bb051a6.png)

Data…

. DG&P-SMA\_lot 6 … Nieuwbouw en verbouwing school Lot 6.Omgevingsaanl…  
. Vlaamse Maatschappij voor Sociaal Wonen-WI 0EDAAE05 … Wegen-, riolerings- en omgevingswerken project Kunstberg te LUMMEN .  
. Gemeente Oostkamp-PPP05R… Herinrichting Moerbrugsestraa…  
. Gemeente Oostkamp-PPP05R… Renoveren van een woning met herinrichting tot doorgangswoning .  
. Gemeente Heist-op-den-Be… 2018-02.04 - rotonde Broekstraat .  
. Wommelgem-WOM/2… Heraanleg Ternesselei-Das…  
. Universiteit Gent-21VOM006 … Externe preventieadvise…  
. ANB-NISIP-SIGMA… Blue Deal - cluster vallei van de Grote Nete - Zammelsbroek: RAAMOVEREENKOMS…  
. inBW-PPP0HS-885… Invitation à présenter une offre - Court-Saint-Eti…  
. Etalle-PPP0XS-2… Réfection de voiries à Mortinsart PIC 2019-2021 .

---

<div class="post-metadata">

**Author:** ![aworker](https://forum-cdn.knime.com/user_avatar/forum.knime.com/aworker/32/36421_2.png) [@aworker](https://forum.knime.com/u/aworker)\
**Post date:** [September 20, 2021, 6:35am UTC](https://forum.knime.com/t/delete-unnecessary-characters-in-data/36197/4 "2021-09-20T06:35:43Z")

</div>

HI @umutcankurt

Thnaks for posting the data. Unfortunately the copy and paste on the editor suppressed the special characters. To exactly know what are this characters, could you please post the text in a file, making sure they are not transformed or suppressed ? Alternatively, may be you could post it (copy and paste here again) but within the option \</\> which should preserve the special characters.

![image](https://forum-cdn.knime.com/uploads/default/original/3X/3/d/3d3cc2d27e6725ebfc35751f29a990d8e36bdf31.png)

Thanks and looking forward.

Best

---

<div class="post-metadata">

**Author:** ![Experimenter](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/e/5daacb/32.png) [@Experimenter](https://forum.knime.com/u/Experimenter)\
**Post date:** [September 20, 2021, 7:07am UTC](https://forum.knime.com/t/delete-unnecessary-characters-in-data/36197/5 "2021-09-20T07:07:25Z")

</div>

What methods did you try? From your screenshot it looks that you have there same length substrings to be removed, so I can’t see why node “String Manipulation” with replace function would not help.

---

<div class="post-metadata">

**Author:** ![umutcankurt](https://forum-cdn.knime.com/user_avatar/forum.knime.com/umutcankurt/32/70644_2.png) [@umutcankurt](https://forum.knime.com/u/umutcankurt)\
**Post date:** [September 20, 2021, 11:41am UTC](https://forum.knime.com/t/delete-unnecessary-characters-in-data/36197/6 "2021-09-20T11:41:59Z")

</div>

[Microsoft Excel \_\_.xlsx](https://forum.knime.com/uploads/short-url/gfZia9AQGHokW6y1wwl1GpaHXxv.xlsx) (13.0 KB)  
Hi; @aworker I attached the file.

---

<div class="post-metadata">

**Author:** ![umutcankurt](https://forum-cdn.knime.com/user_avatar/forum.knime.com/umutcankurt/32/70644_2.png) [@umutcankurt](https://forum.knime.com/u/umutcankurt)\
**Post date:** [September 20, 2021, 11:43am UTC](https://forum.knime.com/t/delete-unnecessary-characters-in-data/36197/7 "2021-09-20T11:43:37Z")

</div>

Hi; @Experimenter  
deletes or shreds after the special character. I just want the characters we want to be deleted and the text to remain intact. I couldn’t do that in my experiments.

---

<div class="post-metadata">

**Author:** ![aworker](https://forum-cdn.knime.com/user_avatar/forum.knime.com/aworker/32/36421_2.png) [@aworker](https://forum.knime.com/u/aworker)\
**Post date:** [September 20, 2021, 11:58am UTC](https://forum.knime.com/t/delete-unnecessary-characters-in-data/36197/8 "2021-09-20T11:58:41Z")

</div>

Thanks @umutcankurt

I’m entering a meeting now but I’ll be able to have a look after it, in about an hour.

---

<div class="post-metadata">

**Author:** ![aworker](https://forum-cdn.knime.com/user_avatar/forum.knime.com/aworker/32/36421_2.png) [@aworker](https://forum.knime.com/u/aworker)\
**Post date:** [September 20, 2021, 1:26pm UTC](https://forum.knime.com/t/delete-unnecessary-characters-in-data/36197/9 "2021-09-20T13:26:03Z")

</div>

Hi @umutcankurt

Please find below the solution based on a -String Manipulation- node using imbricated replace() functions:

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/6/7/678f46a0f0f66a6bc081c9483b9f3450281d4256.png)

`replace( replace( replace( $Data$, "\\...", ""), "\\..", ""), "\\.", "")`

Maybe the difficulty here is to know that they can be imbricated but most importantly, one need to protect first the `\` sign because it is interpreted and secondly to remove the `"\\..."` and then the `"\\.."` and then the `"\\."` in this order. If it is not done in this order, they may not be removed entirely or properly, leaving trailing orphan dots “.”.

The workflow:

[20210920 Pikairos delete unnecessary characters in data.knwf](https://forum.knime.com/uploads/short-url/xhpi9wcTgeRqbq3YW7znrXb0QJ3.knwf) (37.8 KB)

Hope this helps.

Best,

Christophe

---

<div class="post-metadata">

**Author:** ![bruno29a](https://forum-cdn.knime.com/user_avatar/forum.knime.com/bruno29a/32/28802_2.png) [@bruno29a](https://forum.knime.com/u/bruno29a)\
**Post date:** [September 20, 2021, 1:34pm UTC](https://forum.knime.com/t/delete-unnecessary-characters-in-data/36197/10 "2021-09-20T13:34:39Z")

</div>

Hi @umutcankurt , you could also show us what you have attempted so we can point you to the right direction.

I have a feeling that you did not escape your string to be replaced.

For example, if you want to look for:  
`\.\.\...`  
then you need to escape the slashes, and look for:  
`\\.\\.\\...`

One of the reasons I usually do not participate in this type of discussion is because it’s hard to set some replacement rules when the rules are not given, and ends up in a long thread of back and forth, because we give the solution for what was given for a sample data, then the author usually comes back with other rules that are in place and conflict with the proposed solution, and then later comes back with exceptions to be added.

In your case, what are the string or strings that need to be removed? I see that there are “`\.\.\..`” and also “`\.\.\...`”. Are these 2 strings to be removed? Or is “`\.\.\...`” simply “`\.\.\..`” followed by a period that needs to be kept (in which case, only “`\.\.\..`” needs to be replaced)?

---

<div class="post-metadata">

**Author:** ![umutcankurt](https://forum-cdn.knime.com/user_avatar/forum.knime.com/umutcankurt/32/70644_2.png) [@umutcankurt](https://forum.knime.com/u/umutcankurt)\
**Post date:** [September 20, 2021, 2:39pm UTC](https://forum.knime.com/t/delete-unnecessary-characters-in-data/36197/11 "2021-09-20T14:39:00Z")

</div>

> [@bruno29a](#):
>
> you could also show us what you have attempted so we can point you to the right direction.
> 
> I have a feeling that you did not escape your string to be replaced.
> 
> For example, if you want to look for:  
> `\.\.\...`  
> then you need to escape the slashes, and look for:  
> `\\.\\.\\...`
> 
> One of the reasons I usually do not participate in this type of discussion is because it’s hard to set some replacement rules when the rules are not given, and ends up in a long thread of back and forth, because we give the solution for what was given for a sample data, then the author usually comes back with other rules that are in place and conflict with the proposed solution, and then later comes back with exceptions to be added.
> 
> In your case, what are the string or strings that need to be removed? I see that there are “`\.\.\..`” and also “`\.\.\...`”. Are these 2 strings to be removed? Or is “`\.\.\...`” simply “`\.\.\..`” followed by a period that needs to be kept (in which case, only “`\.\.\..`” needs to be replaced)?

Thank you so much. You found the solution I was looking for. 👍

---

<div class="post-metadata">

**Author:** ![umutcankurt](https://forum-cdn.knime.com/user_avatar/forum.knime.com/umutcankurt/32/70644_2.png) [@umutcankurt](https://forum.knime.com/u/umutcankurt)\
**Post date:** [September 20, 2021, 2:40pm UTC](https://forum.knime.com/t/delete-unnecessary-characters-in-data/36197/12 "2021-09-20T14:40:58Z")

</div>

@aworker Thank you so much. You found the solution I was looking for. 👍

---

<div class="post-metadata">

**Author:** ![aworker](https://forum-cdn.knime.com/user_avatar/forum.knime.com/aworker/32/36421_2.png) [@aworker](https://forum.knime.com/u/aworker)\
**Post date:** [September 20, 2021, 2:42pm UTC](https://forum.knime.com/t/delete-unnecessary-characters-in-data/36197/13 "2021-09-20T14:42:04Z")

</div>

Thanks @umutcankurt. My pleasure 😊 !

---

<div class="post-metadata">

**Author:** ![Unzy](https://forum-cdn.knime.com/user_avatar/forum.knime.com/unzy/32/28808_2.png) [@Unzy](https://forum.knime.com/u/Unzy)\
**Post date:** [September 22, 2021, 4:01am UTC](https://forum.knime.com/t/delete-unnecessary-characters-in-data/36197/14 "2021-09-22T04:01:06Z")

</div>

You could also try using the String Replacer node with a regex replacement.  
I used [^a-zA-Z0-9] to keep only alphanumeric and spaces.

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/3/b/3b2c9639dffe5acff392008eab73f81a69773e3a.png)

---

<div class="post-metadata">

**Author:** ![umutcankurt](https://forum-cdn.knime.com/user_avatar/forum.knime.com/umutcankurt/32/70644_2.png) [@umutcankurt](https://forum.knime.com/u/umutcankurt)\
**Post date:** [September 22, 2021, 5:28am UTC](https://forum.knime.com/t/delete-unnecessary-characters-in-data/36197/15 "2021-09-22T05:28:06Z")

</div>

👍 thanks for sharing

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [September 29, 2021, 5:28am UTC](https://forum.knime.com/t/delete-unnecessary-characters-in-data/36197/16 "2021-09-29T05:28:27Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
