Notepad++ batch replace specific lines?

pmolson
2012-11-09
2012-11-14
  • pmolson
    pmolson
    2012-11-09

    First of, I'm not a Coder or Unix guy, I'm using notepad++ v6.18 on Win7, so I'd ask that you "dumb it down" for me please :)

    I've noticed that on the left side of each line within a notepad++ file there are numbers in "gray" , indicating the corresponding line number, so I thought the "Find & Replace" feature would be straight-fwd (i.e replace line 17 in file 1 with line 2 in file 2) wouldn't that be nice!!! Well, I was wrong and I can't seem to find a way to achieve what I'm trying to do…

    I have 2 txt (or xml files) f1 & f2 and what I'm trying to do is here is replace certain lines within f1 with a given line in f2…

    And here is an example…

    file 1 (with several hundred lines)

    (item)(title)ABC(/title)(link)a_bunch_of_code(/link)(/item)

    (item)(title)XYZ(/title)(link)a_different_code(/link)(/item)

    etc…

    file 2 (each line has a different code)

    hkskskdnnkk

    absvdhvskkcncl

    etc…

    And what I want to do is… replace line 1 in file 1 with line 2 of file 2 then replace line 2 in file 1 with line 1 in file 2 etc…So ideally I'm thinking of some command or script that says…find line 1 in file 1 and replace it with line 2 in file 2 then find line 2 in file 1 and replace it with line 1 in file 2 etc…

    Maybe this has to be done outside Notepad++ using a 3rd party tool or something…Please advise and thank you in advance! -Paul