3.42 mproduct - Cartesian Join with Reference File

Combine every row of column specified at f= parameter from the reference file at the m= parameter with every record from the input file.

Format

mproduct [f=] m=| i= [o=] [bufcount=] [-nfn] [-nfno] [-x] [--help] [--version]

Parameters

f=

Combine field name(s) (multiple fields can be specified) from reference file.

 

All field(s) are combine if this parameter is not specified.

m=

Specify reference file name.

 

Read from standard input if this parameter is not defined (when i= is specified).

Examples

Example 1: Basic Example

Combine the ¥verb|date| column from reference file to the ¥verb|customer| column from the input file.

$ more dat1.csv
customer
A
B
$ more ref1.csv
date
20090101
20090201
20090301
$ mproduct f=date m=ref1.csv i=dat1.csv o=rsl1.csv
#END# kgproduct f=date i=dat1.csv m=ref1.csv o=rsl1.csv
$ more rsl1.csv
customer,date
A,20090101
A,20090201
A,20090301
B,20090101
B,20090201
B,20090301

Related Command

mnjoin : Similar operation with mproduct but join key is specified.