Quantcast
Channel: Questions in topic: "splunk-enterprise"
Viewing all articles
Browse latest Browse all 47296

How to edit my regex to extract fields from an imported CSV file with extra commas in some rows?

$
0
0
So this is fun... I need to import a CSV on a regular basis, and I have no control over the format or data in the csv. Contents include: name1-name2-Uptime,N. California [RealBrowser],8419,100,0,23 name1-name2-Uptime,N. Virginia [RealBrowser],10062,100,0,25 name1-name2-Uptime,Chicago, IL [RealBrowser],6882,95.83300018,1,24 name1-name2-Uptime,Dallas, TX [RealBrowser],9558,100,0,23 Some of the second columns have commas, but not all, and my regex is getting thrown by them. I've tried the following regex, but it combines the second, third and fourth columns. ^(?[^,]+),(?.*),(?[^,]+)

Viewing all articles
Browse latest Browse all 47296

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>