# Extract single line CSV data into multiple columns

**URL:** <https://community.dynatrace.com/t/extract-single-line-csv-data-into-multiple-columns/46939>\
**Category:** DQL\
**Tags:** dql, csv, notebooks, logs, dpl\
**Created:** [August 1, 2024, 8:45am UTC](https://community.dynatrace.com/t/extract-single-line-csv-data-into-multiple-columns/46939 "2024-08-01T08:45:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![avdveen](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@avdveen](https://community.dynatrace.com/u/avdveen)\
**Post date:** [August 1, 2024, 8:45am UTC](https://community.dynatrace.com/t/extract-single-line-csv-data-into-multiple-columns/46939/1 "2024-08-01T08:45:53Z")

</div>

Hi, I’m trying to get the data in a CSV log file split into separate columns, but I’m stuck with DQL/DPL.  
Any help would be super appreciated!

Also, I assume I’d need a metric for each column if I want to get the values onto a dashboard, right?  
Each value separated by a comma, needs to fall into the columns below.

 ![andre_vdveen_1-1722501799170.png](https://global.discourse-cdn.com/dynatrace/original/3X/0/c/0c9b1b910dc46bf3db5753c9bded73a7228c4b84.png)

Here’s the raw data - the masked text goes with ‘Claims’ or ‘Batch Claims’ and is called the ‘Component’ in the example above:

 ![andre_vdveen_0-1722501653700.png](https://global.discourse-cdn.com/dynatrace/original/3X/5/a/5a49a48ffc9f3f63e11aaaa0c5282c0b4407c1f9.png)

---

<div class="post-metadata">

**Author:** ![avdveen](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@avdveen](https://community.dynatrace.com/u/avdveen)\
**Post date:** [August 1, 2024, 11:12am UTC](https://community.dynatrace.com/t/extract-single-line-csv-data-into-multiple-columns/46939/2 "2024-08-01T11:12:12Z")

</div>

Figured the 1st part out, with some help:

```markup
parse (content, "(LD:dup_timeStamp LD:component FLOAT:AvgTime INT:NoOfClaims INT:WorstTime INT:Time_Outs INT:Exceptions FLOAT:Standin )(fs=',')")

```

---

<div class="post-metadata">

**Author:** ![y\_buccellato](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/y_buccellato/32/160_2.png) [@y\_buccellato](https://community.dynatrace.com/u/y_buccellato)\
**Post date:** [August 23, 2024, 1:25pm UTC](https://community.dynatrace.com/t/extract-single-line-csv-data-into-multiple-columns/46939/3 "2024-08-23T13:25:54Z")

</div>

I’m in a similar situation.  
Kinda surprise that with all the DQL power you cannot auto parse a field which contains multiple value divided by comma “,”.  
My love for excel still persist 😄

---

<div class="post-metadata">

**Author:** ![36Krazyfists](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/36krazyfists/32/37434_2.png) [@36Krazyfists](https://community.dynatrace.com/u/36Krazyfists)\
**Post date:** [September 10, 2025, 8:06pm UTC](https://community.dynatrace.com/t/extract-single-line-csv-data-into-multiple-columns/46939/4 "2025-09-10T20:06:37Z")

</div>

So, you could potentially do this with a sophisticated enough DPL query, however, the main problem is that you have to know the CSV headers ahead of time.

For example, I have tons of pipelines that auto-parse JSON and XML logs data, but that’s because the JSON/XML records contain the key names and the values in each record.&nbsp; With CSV, only the first line of a log file would potentially have the column names, and since the log parsing is done one line at a time, it has no way to know about the headers defined in some other record earlier that day or week, so you would have to build a DPL parser that defines the name of each item.
