Forrest logo
back to the tsv-filter tool

tsv-filter:tldr:40387

tsv-filter: Print the lines that satisfy two conditions.
$ tsv-filter --eq ${column_number1}:${number} --str-eq ${column_number2}:${string} ${path-to-tsv_file}
try on your machine

The command "tsv-filter" is a command-line tool used to filter TSV (Tab-separated values) files based on specific conditions. TSV files are text files where columns are separated by tabs.

Here is the breakdown of the command:

  1. "tsv-filter" is the command itself.

  2. "--eq" specifies that we want to filter based on equality.

  3. "${column_number1}" represents the column number in the TSV file that we are filtering. You need to replace it with the actual column number you want to filter on.

  4. "${number}" represents the specific value in the column that we are looking for. It can be replaced with the specific number you want to filter on.

  5. "--str-eq" specifies that we want to filter based on string equality.

  6. "${column_number2}" represents the column number in the TSV file that we are filtering. You need to replace it with the actual column number you want to filter on.

  7. "${string}" represents the specific string value in the column that we are looking for. It can be replaced with the specific string you want to filter on.

  8. "${path-to-tsv_file}" represents the path to the TSV file you want to filter. You need to replace it with the actual file path.

In summary, this command filters a TSV file, keeping only the rows where the value in a specific column (specified by column_number1) matches the given number (specified by number) and the value in another specific column (specified by column_number2) matches the given string (specified by string). The resulting filtered TSV file will be outputted.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the tsv-filter tool