Show/Hide Toolbars

EmEditor Help

Navigation: EmEditor Help > Plug-in Reference > Inline Functions

EmEditor Plug-in Reference: Editor_Join

Scroll Prev Top Next More
EmEditor Home - EmEditor Help - Plug-in Reference - Inline Functions

Editor_Join

Combines two CSV documents specifying key columns, using a method similar to JOIN operations, and creates a new document. You can use this inline function or explicitly send the EE_JOIN message.

Editor_Join( HWND hwnd, UINT nFlags, LPCWSTR pszDocument1, LPCWSTR pszColumn1, LPCWSTR pszDocument2, LPCWSTR pszColumn2, LPCWSTR pszSelect, int* piDocument3 );

Parameters

hwnd

Specifies the window handle of the view or frame of EmEditor.

nFlags

You can specify a combination of the following values.

JOIN_FLAG_UNIQUE_KEY_1

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

JOIN_FLAG_UNIQUE_KEY_2

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

JOIN_FLAG_INCLUDE_ALL_1

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.

JOIN_FLAG_INCLUDE_ALL_2

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.

JOIN_FLAG_MATCH_CASE

Matches cases.

pszDocument1

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", or ":2".

pszColumn1

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".

pszDocument2

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

pszColumn2

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

pszSelect

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

piDocument3

This field will be filled with the index of the output document when the function returns. If this is NULL, this field will be ignored.

Return Values

The return value is the number of the lines in the new document. The return value is a negative value if an error occurs. If an error occurs, the return value can be one of the following values:

E_DOCUMENT_1_NOT_FOUND

Cannot find the first document.

E_DOCUMENT_2_NOT_FOUND

Cannot find the second document.

E_COLUMN_1_NOT_FOUND

Cannot find the first column.

E_COLUMN_2_NOT_FOUND

Cannot find the second column.

E_SELECT_SYNTAX

Syntax error in the Select string.

E_SELECT_DOCUMENT_NOT_FOUND

Cannot find a specified document in the Select string.

E_SELECT_COLUMN_NOT_FOUND

Cannot find a specified column in the Select string.

E_DIFFERENT_CSV_MODE

Different CSV modes.

E_NOT_MDI

Tabs must be enabled.

E_WRITE_TEMP_FILE

Temporary file write error.

E_ABORT

Aborted by a user.

E_FAIL

Unspecified error.

Version

Supported on EmEditor Professional Version 14.8 or later.

Copyright © 2003-2016 by Emurasoft, Inc.