Removing Certain Characters from a String

  • Last update:  2022-04-15
  • 1. Overview

    1.1 Expected effect

    Users sometimes need to clean out some unwanted characters in the data.

    For example, remove the "[]" and the contents in between in the table, as shown below.

    5.png

    1.2 Implementation idea

    First use the FIND function to find the position of "[" and "]" in the string, and then use the replace function to replace part of a text string with a null value according to the specified number of characters.

    2. Operation steps

    2.1 Create Self-Service dataset

    Create a new Self-Service dataset and check the fields that need to be checked in, as shown in the following figure.

    6.png

    2.2 Add new column

    Click "add", select New Column, and enter a name for the new column in the new column settings box that pops up in the system to add a formula, as shown in the following figure.

    7.png

    The formula uses two functions, details can be seen: text function

    1)REPLACE

    REPLACE(old_text,start_num,num_chars,new_text), you can specify the number of characters, according to the number of other text strings to replace a text string in part. Example: REPLACE("0123456789",5,4,"*")is equal to 0123*89, which will replace the 4-bit text string with * after the 5th character in 0123456456789.

    2)FIND

    FIND(find_text,within_text,start_num), starting at the specified index (start_num), return the first occurrence of the specified substring (find_text) in the index of this string (within_text).

    Example: FIND("i","Information",1) equals 9 。

    3. Effect view

    After clicking "OK", you can see that the new column "[]" and the contents in the middle are not displayed, as shown in the following figure.

    8.png

    附件列表


    主题: Advanced Data Analysis
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy