explode
The explode
command splits a column into multiple rows based on a delimiter.
Syntax
qsv explode [options] <column> <input_file> [<output_file>]
Description
The explode
command is used to split a column into multiple rows based on a delimiter. This is useful for transforming data from a compact format to a more normalized format.
Options
-d, --delimiter <delimiter>
: Specify the delimiter to split on--no-headers
: When set, the first row will not be interpreted as headers
Examples
Explode Column
Split the colors
column into multiple rows based on the ,
delimiter:
qsv explode -d , colors DLD_Transactions_English_500.csv | qsv table
Common Use Cases
- Transforming data from a compact format to a more normalized format
- Preparing data for analysis or processing
Tips
- Verify the output to ensure the data is correctly exploded
- Use in combination with other commands for complex data processing