It's a SQL instance and the examples are as follows:
Table values to transform:
String is Donald.Duck and the desired result is DDuck String is Mickey.Mouse and the desired result is MMouse
It's a SQL instance and the examples are as follows:
Table values to transform:
String is Donald.Duck and the desired result is DDuck String is Mickey.Mouse and the desired result is MMouse
you can use a regular expression in sql. it runs slower but it will use the dot.net framework
The regular expression is simple. Look forward and find a period then capture all non space characters proceeding the period.
how to call a regular expression in tsql
https://www.sqlshack.com/t-sql-regex-commands-in-sql-server/
#extract the data to a csv then process it and update back into the database
txt="Donald.Duck and the desired result is DDuck String other strings are Mickey.Mouse and Daffy.Duck"
pattern = re.compile(r'([a-zA-Z]+\.[a-zA-Z]+)')
result=re.findall(pattern,txt)
for item in result:
front,back=item.split('.')
txt=re.sub(item, front[0]+'.'+back,txt)
print(txt)
output
Donald.Duck and the desired result is DDuck String other strings are Mickey.Mouse and Daffy.Duck
Sql steps: