Getting Data In

How can I index data from a CSV file with 2 header lines

dajomas
Path Finder

Hi all,

I have CSV files  (they are exports from the Garmin R10 launch monitor session data via the Garmin Golf app) that contain 2 header lines, the first header line contains the field names and the second header line contains the unit of measurement (or blank if not applicable)

For example:

Date,Player,Club Name,Club Type,Club Speed,Attack Angle,...
,,,,[mph],[deg],...
09/10/23 10:00:45 AM,Johan,7 Iron,7 Iron,70.30108663634557,-7.360383987426758,...

 

Now, I would like to index the data in one of 2 ways:

  1. Add the unit of measurement to the value
    1. so that would become "70.30108663634557mph" for the Club Speed field
  2. Add an additional column that contains the unit of measurement
    1. Add column "Club Speed UOM" with value mph for every line indexed from the CSV file and do this for every column that contains a valid unit of measurement

For me, option 2 would be the preferred option

A third option, would be to skip the unit of measurement line altogether but I would rather not use this option.

 

I would appreciate any help that points me in the right direction to solve this challenge.

 

Thanx in advance.

Labels (1)
Tags (3)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

I would write a script that converts the CSV into K=V format and run it as a scripted input.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

The Payment Operations Wake-Up Call: Why Financial Institutions Can't Afford ...

The same scenario plays out across financial institutions daily. A payment system fails at 11:30 AM on a busy ...

Make Your Case: A Ready-to-Send Letter for Getting Approval to Attend .conf25

Hello Splunkers, Want to attend .conf25 in Boston this year but not sure how to convince your manager? We've ...

Community Spotlight: A Splunk Expert's Journey

In the world of data analytics, some journeys leave a lasting impact not only on the individual but on the ...