Search
 
SCRIPT & CODE EXAMPLE
 

SQL

bigquery function

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 :: run sql command line download 
Sql :: sql int size 
Sql :: reseed sql identity 
Sql :: import DB through mysql console 
Sql :: How to do IF NOT EXISTS in SQLite 
Sql :: sql id serial primary key 
Sql :: insert into with 3 tables 
Sql :: kill mysqld_safe process mariadb 
Sql :: https://www.jitendrazaa.com/blog/sql/sqlserver/export-documents-saved-as-blob-binary-from-sql-server/ 
Csharp :: dotnet install ef 
Csharp :: how to restart a scene in unity 
Csharp :: unity change tag in script 
Csharp :: add only bottom border to container flutter 
Csharp :: ngrok for asp.net core 
Csharp :: unity gameobject teleporting 
Csharp :: c# exit console 
Csharp :: c# input integer 
Csharp :: c# error messagebox 
Csharp :: restclient basic auth c# 
Csharp :: unity quit code 
Csharp :: loop through enum c# 
Csharp :: check last character of a string c# 
Csharp :: ping with c# 
Csharp :: c# check if list contains string case insensitive 
Csharp :: c# loop through array 
Csharp :: how o remove .meta files visual studio code 
Csharp :: how to do cmd command c# 
Csharp :: how to split and get last index values in c# 
Csharp :: unity flexiable space 
Csharp :: backcolor c# hexadecimal 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =