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!

Splunk Observability Cloud | Unified Identity - Now Available for Existing Splunk ...

Raise your hand if you’ve already forgotten your username or password when logging into an account. (We can’t ...

Index This | How many sides does a circle have?

February 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

Registration for Splunk University is Now Open!

Are you ready for an adventure in learning?   Brace yourselves because Splunk University is back, and it's ...