Search code examples
texteditemeditor

How do I do this with Emeditor or any text editing tool


I have 2 text files.

The first one has letters like this:

Message1:A

Message2:B

Message3:C

Message4:D

Message5:E

....

The second text file has letter like this:

D:Answer4

A:Answer1

E:Answer5

C:Answer3

B:Answer2

...

I want to match 2 of them so I can get the result:

Message1:Answer1

Message2:Answer2

Message3:Answer3

Message4:Answer4

Message5:Answer5

...

Please note that sorting them A-Z , Z-A, 1-9 , long-short , short-long is not allowed (Any kinds of sorting) The 2 text files are randomized before editing.

Thanks!


Solution

  • If you use EmEditor, you can use the Join CSV feature of EmEditor.

    1. Go to the Tools menu, select Customize, CSV page, click Add button to define a Colon format: Enter "Colon separated" in the CSV Formats list. Enter "Colon" to the Toolbar button title. Enter : (a colon) to the Delimiter. Disable Allow delimiters in double quotes.

    Customize dialog- CSV page

    1. Open your first text file, and click the Colon format in the CSV/Sort toolbar. Do the same with the second file.

    2. Click Join CSV button in the CSV/Sort toolbar.

    CSV/Sort toolbar

    1. In the Join CSV dialog box, select options exactly as shown in the screenshot. Click the Join Now button.

    Join CSV dialog

    1. A new document will be created with the expected results.

    Results