3.66 mvcat - Combine Vectors

Merge multiple vectors into one vector.

Examples are shown in Table 3.34, 3.34 and 3.35.

Table 3.34: Input data
in.csv

no

items1,items2

1

a c,b

2

a d,a e

3

b f,

4

e,e

: Caption text
Basic example mvcat vf=item1,items2 a=catItems i=in.csv

no

catItems

1

a c b

2

a d a e

3

b f

4

e e

Table 3.35: Retain original vectors before merging
mvcat vf=item1,items2 -A i=in.csv

no

items1,items2,new

1

a c,b,a c b

2

a d,a e,a d a e

3

b f,,b f

4

e,e,e e

Format

mvcat vf= a= [-A] [i=] [o=] [delim=] [-nfn] [-nfno] [-x] [--help] [--version]

vf=

Merge specified field names of vectors (from the input file i=).

 

Wildcard can be substituted for a character within the field name.

a=

Field name of the merged vector.

-A

Add results as a new field. If this option is not specified, the original field (vf=) will be removed.

Examples

Example 1: Merge vectors using wild character

$ more dat1.csv
items1,items2,items3,items4
b a c,b,x,y
c c,,x,y
e a a,a a a,x,y
$ mvcat vf=items* a=items i=dat1.csv o=rsl1.csv
#END# kgvcat a=items i=dat1.csv o=rsl1.csv vf=items*
$ more rsl1.csv
items
b a c b x y
c c x y
e a a a a a x y

Related command