Funciones
Las funciones se utilizan para
anonimizar datos mediante una regla.
Gigantics ofrece funciones por defecto que se pueden modificar al editar la
regla. Las opciones de la función varían según el tipo de dato contenido en la
celda de la tabla.
Funciones disponibles:
Mask
Enmascara el dato transformando o reemplazando el valor actual. Opciones:
Text transform (string/char)
Transforma el texto al formato seleccionado.
| Valor | Nuevo valor | ||
|---|---|---|---|
| None | foo bar | → | foo bar |
| Uppercase | foo bar | → | FOO BAR |
| lowercase | FOO Bar | → | foo bar |
| Title case | foo bar | → | Foo Bar |
| Snake case | foo bar | → | foo_bar |
| Kebab case | foo bar | → | foo-bar |
Replace (any)
Reemplaza el valor seleccionado por uno diferente
Alphabetical chars / Digits / Symbols
Reemplaza cada carácter alfabético por otro carácter. Este reemplazo puede ser parcial o condicional:
- With: Caracter con el que se reemplazarán todos los caracteres alfabéticos:
| Valor | With | Nuevo valor | |
|---|---|---|---|
| foo bar | x | → | xxx xxx |
| testing char | x | → | xxxxxxx xxxx |
| 1234 | 0 | → | 0000 |
| 1234753-H | 0 | → | 0000000-H |
| 123.65 | , | → | 123,65 |
| $99 | £ | → | £99 |
-
Field length: Cambia la longitud del nuevo valor:
- Initial: Mantiene la longitud actual.
- Random: Longitud aleatoria.
- Fixed: Misma longitud para todos.
| Tipo | Valor | With | Long. | Nuevo valor | |
|---|---|---|---|---|---|
| Initial | foo bar | Y | - | → | YYY YYY |
| Initial | 123456 | 0 | - | → | 000000 |
| Random | testing char | Y | - | → | YY YYYYYYY |
| Fixed | new gigantics | Y | 2 | → | YY YY |
- Condition: Mantiene o reemplaza parte de la cadena:
| Valor | With | Condition | # Chars | Nuevo valor | |
|---|---|---|---|---|---|
| foo bar | z | Keep first | 2 | → | foz zzz |
| foo bar | z | Keep last | 4 | → | zoo bar |
| testing char | z | Replace first | 1 | → | zesting char |
| new gigantics | z | Replace last | 3 | → | new giganzzz |
Word
Reemplaza la palabra completa:
| Valor | With | Nuevo valor | |
|---|---|---|---|
| John | Test | → | Test |
| Sarah | Test | → | Test |
| Sarah Cruz | Test | → | Test Test |
Regex
Reemplaza caracteres/números/símbolos usando regex
| Valor | Regex | Replace with | Nuevo valor | |
|---|---|---|---|---|
test@email.com | .+?(?=@) | xxxx | → | xxxx@email.com |
| (+34) 603402022 | (?:00|\+)\?[0-9]{2} | 0 | → | (+00) 603402022 |
Field
Reemplaza todo el campo con un nuevo valor:
| Valor | With | Nuevo valor | |
|---|---|---|---|
| test multiple field | undefined | → | undefined |
| 769C Honey Creek St. | Unamed Road | → | Unnamed Road |
| data:image/png;base64 | img | → | img |
Shuffle
Recoge los valores de la columna y los mezcla aleatoriamente.
Ejemplo:
Entrada
- Columna a mezclar:
city
| # | street | city | state | |
|---|---|---|---|---|
| 1 | debra.burks@yahoo.com | 9273 Thorne Ave. | Orchard Park | NY |
| 2 | kasha.todd@yahoo.com | 910 Vine Street | Forney | TX |
| 3 | tameka.fisher@aol.com | 769C Honey Creek St. | Redondo Beach | CA |
Salida
| # | street | city | state | |
|---|---|---|---|---|
| 1 | debra.burks@yahoo.com | 9273 Thorne Ave. | Forney | NY |
| 2 | kasha.todd@yahoo.com | 910 Vine Street | Redondo Beach | TX |
| 3 | tameka.fisher@aol.com | 769C Honey Creek St. | Orchard Park | CA |
Shuffle group
Variante donde los campos seleccionados se agrupan y se mezclan juntos.
Entrada
- Columnas:
cityystate
| # | street | city | state | |
|---|---|---|---|---|
| 1 | debra.burks@yahoo.com | 9273 Thorne Ave. | Orchard Park | NY |
| 2 | kasha.todd@yahoo.com | 910 Vine Street | Forney | TX |
| 3 | tameka.fisher@aol.com | 769C Honey Creek St. | Redondo Beach | CA |
| 4 | daryl.spence@aol.com | 988 Pearl Lane | Uniondale | NY |
Salida
| # | street | city | state | |
|---|---|---|---|---|
| 1 | debra.burks@yahoo.com | 9273 Thorne Ave. | Redondo Beach | CA |
| 2 | kasha.todd@yahoo.com | 910 Vine Street | Uniondale | NY |
| 3 | tameka.fisher@aol.com | 769C Honey Creek St. | Forney | TX |
| 4 | daryl.spence@aol.com | 988 Pearl Lane | Orchard Park | NY |
List
Selecciona un valor aleatorio de una lista.
Las listas se crean en la zona de
listas de datos de configuración del proyecto.
Si el número de registros supera el del dataset, los valores se repiten.
Ejemplo:
- Columna:
fruit - Dataset: [Banana, Apple, Pear]
| # | fruit | price |
|---|---|---|
| 1 | Pineapple | $0.60 |
| 2 | Strawberry | $0.40 |
| 3 | Coconut | $2.95 |
Salida
| # | fruit | price |
|---|---|---|
| 1 | Pear | $0.60 |
| 2 | Banana | $0.40 |
| 3 | Apple | $2.95 |
Delete
Establece NULL en la columna seleccionada (no se puede usar en NOT NULL).
Ejemplo (columna price):
| # | fruit | price |
|---|---|---|
| 1 | Pineapple | $0.60 |
| 2 | Strawberry | $0.40 |
| 3 | Coconut | $2.95 |
Salida
| # | fruit | price |
|---|---|---|
| 1 | Pear | NULL |
| 2 | Banana | NULL |
| 3 | Apple | NULL |
Blank
Elimina el valor del campo (cadena vacía).
Ejemplo (columna price):
| # | fruit | price |
|---|---|---|
| 1 | Pineapple | $0.60 |
| 2 | Strawberry | $0.40 |
| 3 | Coconut | $2.95 |
Salida
| # | fruit | price |
|---|---|---|
| 1 | Pear | |
| 2 | Banana | |
| 3 | Apple |