Skip to main content

searchset

The searchset command filters rows in a CSV file based on a set of search terms.

Syntax

qsv searchset [options] <terms> <input_file> [<output_file>]

Description

The searchset command is used to filter rows in a CSV file based on a set of search terms. This is useful for extracting specific subsets of data that match multiple criteria.

Options

  • -c, --column <name>: Specify the column to search
  • --no-headers: When set, the first row will not be interpreted as headers

Examples

Search for Terms

Filter rows that contain the terms Sales and Transaction:

qsv searchset "Sales Transaction" DLD_Transactions_English_500.csv | qsv table

Search in Specific Column

Filter rows that contain the terms Sales and Transaction in the trans_group_en column:

qsv searchset -c trans_group_en "Sales Transaction" DLD_Transactions_English_500.csv | qsv table

Common Use Cases

  • Extracting specific subsets of data
  • Filtering data for analysis

Tips

  • Verify the output to ensure the search is correctly performed
  • Use in combination with other commands for complex data processing

See Also

  • select - for selecting specific columns
  • apply - for data transformations