Replace with text from a list line by line
-
Hello All.
I have 2 txt files. One with text where I need to replace specific words (userID) with actual IDs which are in another document (each in new line). So now it looks like:
Document 1:
texttexttext<userID>texttexttext
texttexttext<userID>texttexttext
texttexttext<userID>texttexttextDocument 2:
asvddsr3132ds
osdc7haisnjci
292jdjdaoiscnAnd need final document:
texttexttext<asvddsr3132ds>texttexttext
texttexttext<osdc7haisnjci>texttexttext
texttexttext<292jdjdaoiscn>texttexttextAs you can see, new userID need to be replaced with new line from document2.
Can somebody help me please ? -
From the given explanation I would select the column and copy the new userids, then I select the userID column and replace it.
Column selection is the key here.
But I suppose in reality it is not so simple. -
@Ekopalypse said in Replace with text from a list line by line:
n selection is the key here.
But I suppose in reality it is not so simple.Nope, it is not really as excel. It look more like:
blablablatexttexte. another bla bla bla <userID> something else, bla bla bla text <userID> something bla bla etc <userID> and so on…
But positive is that what need to be changed is always between <>. -
Nope, it is not really as excel …
and this is crucial to know.
There is no function like read line from doc2 and replace field in doc1.
If the data layout is not known, one cannot provide a reasonable solution.
If the data is sensitive, obfuscate it without destroying the actual layout and post it. -
@Ekopalypse said in Replace with text from a list line by line:
If the data is sensitive
Looks sensitive…looks like passwords.
In general, replacing “from a list” is a tough task for Notepad++
-
Right, I remember guy038 did something like that with regex, but then it’s even more crucial to know the exact layout and a pythonscript might be possible, but I hesitate to think about it or create something without knowing what to do.