Show/Hide Toolbars

EmEditor Help

Navigation: EmEditor Help > Macro Reference > Editor Object > Methods

EmEditor Macro Reference: Join Method

Scroll Prev Top Next More
EmEditor Home - EmEditor Help - EmEditor Macro Reference - Editor Object

Join Method

Combines two CSV documents specifying key columns, using a method similar to JOIN operations, and creates a new document.

[JavaScript]

n = editor.Join( nFlags, strDocument1, strColumn1, strDocument2, strColumn2, strSelect );

[VBScript]

n = editor.Join( nFlags, strDocument1, strColumn1, strDocument2, strColumn2, strSelect )

Parameters

nFlags

You can specify a combination of the following values.

eeJoinUniqueKey1

The specified column in the first document contains a unique key.

eeJoinUniqueKey2

The specified column in the second document contains a unique key.

eeJoinIncludeAll1

All lines in the first document should be included in the output. The output document will contain empty cells if lines in the first document do not have matches.

eeJoinIncludeAll2

All lines in the second document should be included in the output. The output document will contain empty cells if lines in the second document do not have matches.

eeJoinMatchCase

Matches cases.

eeJoinSimpleMerge

Simply merge two documents without using keys. If this is specified, strColumn1 and strColumn2 parameters are ignored.

strDocument1

Specifies the string to identify the first document. This value can be a file name, file name with the full path, or a colon (:) followed by the index of the document in the current group. For example, "filename.csv", "C:\data\filename.csv" (in case of JavaScript, "C:\\data\\filename.csv"), or ":2".

strColumn1

Specifies the string to identify the key column of the first document. This value can be either the first line of the column or a colon (:) followed by the index of the colulmn. For example, "first_name" or ":5".

strDocument2

Specifies the string to identify the second document. The format of this value is the same as strDocument1.

strColumn2

Specifies the string to identify the key column of the second document. The format of this value is the same as strColumn1.

strSelect

Specifies the string to select which columns to include in the output document. For example, "file1.csv>column1,file2.csv>column2".

Return Values

The return value is the number of the lines that match the specified string.

Version

Supported on EmEditor Professional Version 14.8 or later.

Copyright © 2003-2016 by Emurasoft, Inc.