Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save forstie/58f0b78538197c3b6f95d5be8ab97aac to your computer and use it in GitHub Desktop.
Save forstie/58f0b78538197c3b6f95d5be8ab97aac to your computer and use it in GitHub Desktop.
remove noise from text strings using TRANSLATE
--
-- Lets say I have this character data, how do I extract the numeric?
--
-- Q: Library . . . . . . : SYSIBM Number of objects . : 65
-- A: Use the TRANSLATE built-in function to convert all the noise characters to blanks
values bigint(
translate(
'Library . . . . . . : SYSIBM Number of objects . : 65',
' ',
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.:'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment