Descripción
Abra la página Editor de carga de datos y añada el siguiente script de carga a una nueva sección.
El script de carga contiene el texto de una serie de correspondencias corporativas que se enviaron a los empleados de una organización. Los datos ya han sido depurados de cualquier información personal identificable (IPI), salvo el nombre de la empresa y la dirección de correo electrónico que envió cada correspondencia. El cuerpo de cada mensaje se ha contraído en una única cadena continua. En otras palabras, se han eliminado todos los caracteres de formato y de nueva línea.
Nuestros requisitos:
-
Identificar qué mensajes contienen una cadena que incluye la dirección de correo electrónico TestCompanyNameCorrespondence@test.com, junto con una introducción específica enviada a esta dirección que indique que fue el remitente.
-
Queremos flexibilidad en cuanto a qué introducciones identificar, pero también seguir teniendo algunas restricciones definidas. Las introducciones Sender y Sent by se consideran ambas válidas. Para lograr este objetivo, se pueden utilizar patrones regex.
-
La distinción entre mayúsculas y minúsculas en las direcciones de correo electrónico no es un factor a tener en cuenta. Por lo tanto, la búsqueda no debe distinguir entre mayúsculas y minúsculas.
Script de carga
Correspondences:
Load * Inline [
ID|MessageBody
1|Sent by-- TestCompanyNameCorrespondence@test.com Good morning TestCompanyName team! I hope you are all well. I am just reaching out about the fabulous benefits package we launched just year. Our goal is to take a poll of what you all think. Can you please rate the new options from 1-10 in a response to this email, by this Tuesday? Thank you!
2|Sender: TestCompanyNameIT@test.com Did you know you can access our IT portal anytime, from any of your company devices? It's true! Reach out to your team lead to learn more.
3|Sender: TESTCOMPANYNAMECORRESPONDENCE@test.COM URGENT: This is a message to inform employees of an ongoing issue with our local branch. The branch will be closed until further notice. Thank you
4|Sender: TestCompanyNameVolunteering@test.com Dear team! We are looking for volunteers to help with this year's charity event! We need 40 volunteers to help with the event. If you are interested, please send an email to your direct supervisor. Thanks, TestCompanyName team members, for helping make the world a better place!
5|Sender is TestCompanyNameCorrespondence@test.com Hi folks, it's time to announce the annual TestCompanyName staff party! The party will be taking place at the office this year. Please make sure to RSVP, and we hope to see you there! Sincerely, the TestCompanyName management team
] (delimiter is |);
Resultados
Cargue los datos y abra una hoja. Cree una nueva tabla y agregue estos campos como dimensiones:
Agregue la siguiente medida:
=CountRegExI(MessageBody,'(Sender.*TestCompanyNameCorrespondence@test.com)|(Sent by.*TestCompanyNameCorrespondence@test.com)')
En las propiedades de la medida, establezca la función Totales en Sum. Esto configura la fila de totales en la parte superior de la tabla para contar el número total de registros que contribuyen al recuento.
La medida cuenta el número de resultados del patrón regex especificado dentro del contenido del mensaje. En el patrón regex, .* indica cualquier número de cualquier carácter excepto caracteres de inicio en una nueva línea. El patrón también tiene en cuenta la variación en la forma de introducir la dirección de correo electrónico: tanto Sender como Sent by son resultados válidos. La variante CountRegExI() de la función garantiza búsquedas sin distinción entre mayúsculas y minúsculas.
Tabla de resultadosTotals | - | 3 |
1 | Sent by-- TestCompanyNameCorrespondence@test.com Good morning TestCompanyName team! I hope you are all well. I am just reaching out about the fabulous benefits package we launched just year. Our goal is to take a poll of what you all think. Can you please rate the new options from 1-10 in a response to this email, by this Tuesday? Thank you! | 1 |
2 | Sender: TestCompanyNameIT@test.com Did you know you can access our IT portal anytime, from any of your company devices? It's true! Reach out to your team lead to learn more. | 0 |
3 | Sender: TESTCOMPANYNAMECORRESPONDENCE@TEST.COM URGENT: This is a message to inform employees of an ongoing issue with our local branch. The branch will be closed until further notice. Thank you | 1 |
4 | Sender: TestCompanyNameVolunteering@test.com Dear team! We are looking for volunteers to help with this year's charity event! We need 40 volunteers to help with the event. If you are interested, please send an email to your direct supervisor. Thanks, TestCompanyName team members, for helping make the world a better place! | 0 |
5 | Sender is TestCompanyNameCorrespondence@test.com Hi folks, it's time to announce the annual TestCompanyName staff party! The party will be taking place at the office this year. Please make sure to RSVP, and we hope to see you there! Sincerely, the TestCompanyName management team | 1 |
Entre los cinco mensajes, hay tres que coinciden con el patrón regex especificado. Cada mensaje contiene una coincidencia.
Nota informativaLa función MatchRegEx() también es útil para este tipo de casos de uso de la validación.