Hey everyone. I am working on trying to assemble a regular expression to pull fields out of a set of CSV files. The issue is that some of the fields are often empty, but other times, they aren't. I need to parse through them because some values are important, others aren't and I need the ability to send unimportant things to the nullQueue.
Here is an example:
1,
[email protected],3,4,5,6
1,
[email protected],,4,5,6
1,
[email protected],3,4,,6
How can I use a regular expression capture group to still accept this?
Right now I'm building it like this:
(?P<digit1>[^,]+)(?:,)(?P<contact_id>[^,]+)(?:,)(?P<digit3>[^,]+)(?:,)(?P<digit4>[^,]+)(?:,)(?P<digit5>[^,]+)(?:,)(?P<digit6>[^,]+)(?:,)
Any help would be appreciated. This is the first of multiple data sources I have to go through and do this for. Splunk's handling of structured data sucks when you need to selectively keep/throw away data.
... View more