+skiprows
Defining which CSV line numbers or row contents shall be skipped
Description
Only for CSV or TEXT files.
This command is only valid for reading input files, not for writing output files. It allows defining line numbers that shall be skipped when reading a CSV file.
It also allows defining one or more line start strings for lines that shall be skipped when reading the CSV file.
Pattern
+skiprows(line number,line number-line number,...)
+skiprows=string,string,string,...
Skipping modes
There are two modes of using the +skiprows command.
- With numbers and number ranges in a bracket parameter, the respective lines of these line numbers are omitted. Line numbering starts with "1".
- With one string or with a comma-separated series of strings as parameter, all lines starting with one of these strings will be omitted. If the comma is part of a string, it must be escaped like "
Usage Examples
- csvfox infile.csv +skiprows(1-3,10-13) outfile.csv
- Reads infile.csv and outputs all data lines unchanged to output.csv, but omitting the first three lines, as well as the lines ten to thirteen.
- csvfox infile.csv +skiprows=#,*,+++ outfile.csv
- Reads infile.csv, which may contain invalid lines that start with "#","*", or "+++". Then omits these lines and outputs all other data rows unchanged into outfile.csv.