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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...