Please tell me how to remove half-width and full-width spaces.

NishimuraChinatsu-9854 756 Reputation points
2023-02-22T10:05:42.76+00:00

I'd like to use synpase pipeline to check my data.

I'd like to remove any single-byte or double-byte spaces in the data flow.

I don't want to remove the numerical values of the data, only the spaces.

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,378 questions
{count} votes

Accepted answer
  1. AnnuKumari-MSFT 34,556 Reputation points Microsoft Employee Moderator
    2023-02-23T08:13:21.2066667+00:00

    Hi @NishimuraChinatsu-9854 ,

    Thankyou for using Microsoft Q&A platform and thanks for posting your question here.

    As I understand your query, you want to remove the spaces from the source data of your dataflow. Please let me know if that is not the ask here.

    You can use trim() function to remove the leading and trailing spaces from a string.

    In case your requirement is to remove all the spaces from middle of the string too in a particular column, then use: replace(' ','') or in case you have to perform the same transformation with all the columns then use column pattern with the following expression: regexReplace($$,' ','')

    Additional resources: Column patterns in derived column and aggregate


    Hope it helps. Please accept the answer if it was helpful and click on Yes for Was the answer helpful survey

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.