Search
 
SCRIPT & CODE EXAMPLE
 

SQL

bigquery routine

CREATE OR REPLACE FUNCTION `project.database.accent_clean`(txt STRING) RETURNS STRING LANGUAGE js
OPTIONS (description="Removes accented characters that can be troublesome and replaces with plain characters.") AS R"""
var accents = /[ç,æ,œ,á,é,í,ó,ú,à,è,ì,ò,ù,ä,ë,ï,ö,ü,ÿ,â,ê,î,ô,û,å,ø,Ø,Å,Á,À,Â,Ä,È,É,Ê,Ë,Í,Î,Ï,Ì,Ò,Ó,Ô,Ö,Ú,Ù,Û,Ü,Ÿ,Ç,Æ,Œ,ñ]/g

  var replacements = {'ç':'c', 'æ':'ae', 'œ':'oe', 'á':'a', 'é':'e', 'í':'i', 'ó':'o', 'ú':'u', 'à':'a', 'è':'e', 'ì':'i', 'ò':'o', 'ù':'u', 'ä':'a', 'ë':'e', 'ï':'i', 'ö':'o', 'ü':'u', 'ÿ':'y', 'â':'a', 'ê':'e', 'î':'i', 'ô':'o', 'û':'u', 'å':'a', 'ø':'o', 'Ø':'O', 'Å':'A', 'Á':'A', 'À':'A', 'Â':'A', 'Ä':'A', 'È':'E', 'É':'E', 'Ê':'E', 'Ë':'E', 'Í':'I', 'Î':'I', 'Ï':'I', 'Ì':'I', 'Ò':'O', 'Ó':'O', 'Ô':'O', 'Ö':'O', 'Ú':'U', 'Ù':'U', 'Û':'U', 'Ü':'U', 'Ÿ':'Y', 'Ç':'C', 'Æ':'AE', 'Œ':'OE', 'ñ':'n'};
  
  var rtn = txt.replace(accents, m => replacements[m]);
  return rtn
""";
Comment

PREVIOUS NEXT
Code Example
Sql :: parsing float to int in mysql 
Sql :: Extract Data from SQL Server into XML Format 
Sql :: call scalar valued function sql 
Sql :: pl/sql how to delete a trigger 
Sql :: mysql stand for 
Sql :: difference berween database and data base management system 
Sql :: find employee with max salary sql 
Sql :: ffeathers express mysql application users login 
Sql :: add colum in sql 
Csharp :: but dotnet-ef does not exist. 
Csharp :: how to make mouse invisible unity 
Csharp :: convert system.byte a string c# 
Csharp :: asp.net validate web.config 
Csharp :: how to detect a mouse click in unity 
Csharp :: unity button onclick remove listener 
Csharp :: Check object is in layermask unity 
Csharp :: unity ray from mouse position 
Csharp :: how to change image color unity 
Csharp :: unity set object scale 
Csharp :: stop program event in unity code 
Csharp :: enum loop 
Csharp :: get program path c# 
Csharp :: how to move mouse in game c# 
Csharp :: serilog loglevel order 
Csharp :: button color uwp c# 
Csharp :: c# print all property values of object 
Csharp :: how to make c# program run cmd commands 
Csharp :: unity get project file directory 
Csharp :: OnCollision update 
Csharp :: even number checker in c# 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =