Search code examples
notepad++

Notepad++ Merge list


List 1

text1
text2
text3
text4

List 2

value1
value2
value3
value4

Result

text1=value1
text2=value2
text3=value3
text4=value4

How do I do this in Notepad++?


Solution

  • Follows my solution.

    First, concatenate the two lists separating them by a special character (in the following, I will use §):

    text1
    text2
    text3
    text4
    §
    value1
    value2
    value3
    value4
    

    Then:

    1. Find what: ^(?!§$)(?!.*=)(.*)([\w\W]*?^§\r?\n)(.*)\r?\n?
    2. Replace with: $1=$3$2
    3. Ensure to have the following settings:

    Screenshot

    1. Click as many times as needed on the Replace key.
    2. Finally remove the special character.