All Apps and Add-ons

How can I tell xls2csv command to ignore the first x number of rows?

jedatt01
Builder

I have some excel workbooks where the column header is on row 7. How can I tell xls2csv to ignore the first 6 rows and start writing the cvs with headers on row 7?

0 Karma

woodcock
Esteemed Legend

Is this really necessary? Probably ending like this will work:

... | xls2csv MyFileName | where ThisFieldDoesNotExist="So this will drop all events" | inputcsv MyFileName | streamstats count AS serial | search searial >=7 | fields - serial | outputcsv MyFileName
0 Karma

jedatt01
Builder

I see what you are getting at with this. My end goal is to injest the csv's into Splunk. One additional question. Is there a way to make the command pick up all xls files in the /var/run/Splunk directory instead of one by one with explicitly stating the file name?

0 Karma

dominiquevocat
SplunkTrust
SplunkTrust

Nope, not currently. Um, i never needed that but it would be possible to either do a custom command listing all files and modify the xls2csv to accept a prior search result with a list of paths/filenames and process them as a stream.

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...