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
Motivator

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!

Improve Your Security Posture

Watch NowImprove Your Security PostureCustomers are at the center of everything we do at Splunk and security ...

Maximize the Value from Microsoft Defender with Splunk

 Watch NowJoin Splunk and Sens Consulting for this Security Edition Tech TalkWho should attend:  Security ...

This Week's Community Digest - Splunk Community Happenings [6.27.22]

Get the latest news and updates from the Splunk Community here! News From Splunk Answers ✍️ Splunk Answers is ...