Skip to main content

joinp

The joinp command performs a parallel join of two CSV files based on a common column.

Syntax

qsv joinp [options] <common_column> <file1> <common_column> <file2> [<output_file>]

Description

The joinp command is used to perform a parallel join of two CSV files based on a common column. This is useful for combining large datasets efficiently.

Options

  • -L, --left: Perform a left join
  • -R, --right: Perform a right join
  • -I, --inner: Perform an inner join
  • --no-headers: When set, the first row will not be interpreted as headers

Examples

Inner Join

Perform an inner join on the transaction_id column:

qsv joinp -I transaction_id DLD_Transactions_English_500.csv transaction_id DLD_Transactions_English_500.csv | qsv table

Output:

transaction_id  trans_group_en  procedure_name_en  instance_date  property_type_en  property_sub_type_en  property_usage_en  reg_type_en  area_name_en  building_name_en  project_number  project_name_en  master_project_en  nearest_landmark_en  nearest_metro_en  nearest_mall_en  rooms_en  has_parking  procedure_area  actual_worth  meter_sale_price  rent_value  meter_rent_price  no_of_parties_role_1  no_of_parties_role_2  no_of_parties_role_3
1-102-2022-29434 Sales Sell - Pre registration 28-09-2022 Unit Hotel Rooms Hospitality Off-Plan Properties Al Barsha South Fifth TERHAB HOTEL & TOWERS - TOWER 3 1722 TERHAB HOTEL & TOWERS AT JUMEIRAH VILLAGE TRIANGLE Jumeirah Village Triangle Sports City Swimming Academy Damac Properties Marina Mall Studio 1 34.35 555379.00 16168.24 null null 2 1 0
1-11-2024-19676 Sales Sell 31-05-2024 Flat Residential Existing Properties Marsa Dubai MARINA STAR 551 MARINA STAR Dubai Marina Sports City Swimming Academy Jumeirah Beach Residency Marina Mall 2 B/R 1 161.71 3481260.00 21527.80 null null 1 1 0
...

Left Join

Perform a left join on the transaction_id column:

qsv joinp -L transaction_id DLD_Transactions_English_500.csv transaction_id DLD_Transactions_English_500.csv | qsv table

Output:

transaction_id  trans_group_en  procedure_name_en  instance_date  property_type_en  property_sub_type_en  property_usage_en  reg_type_en  area_name_en  building_name_en  project_number  project_name_en  master_project_en  nearest_landmark_en  nearest_metro_en  nearest_mall_en  rooms_en  has_parking  procedure_area  actual_worth  meter_sale_price  rent_value  meter_rent_price  no_of_parties_role_1  no_of_parties_role_2  no_of_parties_role_3
1-102-2022-29434 Sales Sell - Pre registration 28-09-2022 Unit Hotel Rooms Hospitality Off-Plan Properties Al Barsha South Fifth TERHAB HOTEL & TOWERS - TOWER 3 1722 TERHAB HOTEL & TOWERS AT JUMEIRAH VILLAGE TRIANGLE Jumeirah Village Triangle Sports City Swimming Academy Damac Properties Marina Mall Studio 1 34.35 555379.00 16168.24 null null 2 1 0
1-11-2024-19676 Sales Sell 31-05-2024 Flat Residential Existing Properties Marsa Dubai MARINA STAR 551 MARINA STAR Dubai Marina Sports City Swimming Academy Jumeirah Beach Residency Marina Mall 2 B/R 1 161.71 3481260.00 21527.80 null null 1 1 0
...

Right Join

Perform a right join on the transaction_id column:

qsv joinp -R transaction_id DLD_Transactions_English_500.csv transaction_id DLD_Transactions_English_500.csv | qsv table

Output:

transaction_id  trans_group_en  procedure_name_en  instance_date  property_type_en  property_sub_type_en  property_usage_en  reg_type_en  area_name_en  building_name_en  project_number  project_name_en  master_project_en  nearest_landmark_en  nearest_metro_en  nearest_mall_en  rooms_en  has_parking  procedure_area  actual_worth  meter_sale_price  rent_value  meter_rent_price  no_of_parties_role_1  no_of_parties_role_2  no_of_parties_role_3
1-102-2022-29434 Sales Sell - Pre registration 28-09-2022 Unit Hotel Rooms Hospitality Off-Plan Properties Al Barsha South Fifth TERHAB HOTEL & TOWERS - TOWER 3 1722 TERHAB HOTEL & TOWERS AT JUMEIRAH VILLAGE TRIANGLE Jumeirah Village Triangle Sports City Swimming Academy Damac Properties Marina Mall Studio 1 34.35 555379.00 16168.24 null null 2 1 0
1-11-2024-19676 Sales Sell 31-05-2024 Flat Residential Existing Properties Marsa Dubai MARINA STAR 551 MARINA STAR Dubai Marina Sports City Swimming Academy Jumeirah Beach Residency Marina Mall 2 B/R 1 161.71 3481260.00 21527.80 null null 1 1 0
...

Common Use Cases

  • Combining large datasets
  • Joining data from different sources

Tips

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

See Also

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