14 May 2026 01:24 AM
Data is currently in a string from a csv for example
2026-05-13 22:51:49.585,email@email.com,service,com.corp.ag,DENIED,,"designer, app-user"
Need to parse it so the data is in format:
| timestamp | user_email | service | domain | access | field1 | roles |
| 2026-05-13 22:51:49.585 | email@email.com | service | com.corp.ag | DENIED | | designer, app-user |
The issue being the final field is encapsulated within double quotations and has a comma, and there is a field1 value that is null. Using DPL it doesn't like the blank field, and using splitString(data, ",") splits most of the data correctly but incorrectly the final field which is meant to stay together.
14 May 2026 10:55 AM - edited 14 May 2026 11:15 AM
You can handle both cases using the appropriate DPL matchers: `LD*` for the optional/empty `field1` value, and `CSVDQS` for the quoted CSV string in `roles`, since it contains a comma and should remain as one field.
If the CSV value is enclosed in single quotes instead of double quotes, then `CSVSQS` can be used instead.
Featured Posts