Notepad++ find, replace etc
I have a question regarding notepad++.
I have this text:
And this second one:
Basically I want to delete the countries that appear in image 2, from image 1. How can I do this?
notepad++ notepad
add a comment |
I have a question regarding notepad++.
I have this text:
And this second one:
Basically I want to delete the countries that appear in image 2, from image 1. How can I do this?
notepad++ notepad
2
don't put text in images. Paste a small sample so that people can try
– phuclv
Jan 25 at 3:08
add a comment |
I have a question regarding notepad++.
I have this text:
And this second one:
Basically I want to delete the countries that appear in image 2, from image 1. How can I do this?
notepad++ notepad
I have a question regarding notepad++.
I have this text:
And this second one:
Basically I want to delete the countries that appear in image 2, from image 1. How can I do this?
notepad++ notepad
notepad++ notepad
edited Jan 25 at 0:27
Pimp Juice IT
24.9k114177
24.9k114177
asked Jan 24 at 21:46
Alex IonescuAlex Ionescu
62
62
2
don't put text in images. Paste a small sample so that people can try
– phuclv
Jan 25 at 3:08
add a comment |
2
don't put text in images. Paste a small sample so that people can try
– phuclv
Jan 25 at 3:08
2
2
don't put text in images. Paste a small sample so that people can try
– phuclv
Jan 25 at 3:08
don't put text in images. Paste a small sample so that people can try
– phuclv
Jan 25 at 3:08
add a comment |
2 Answers
2
active
oldest
votes
You should be able to do this in Notepad++ as follows:
- Use a normal Find & Replace to replace all the commas in List 2 with
,|
, so you end up with a list of countries to delete likeCountry1,|Country2,|Country3,
. - Use this new list as the search term in a Regular Expression mode Find & Replace on List 1, with a blank as the replacement text.
Note that this assumes that country names are just separated by commas (no spaces). The last entry in List 1 should also be followed by a comma, otherwise it won't get matched by the search.
note thatCountry3
doesn't have a comma so you'll have a redundant comma where it was removed
– phuclv
Jan 25 at 3:10
Good spot @phuclv. I've updated my answer to correct this.
– JRI
Jan 25 at 9:11
you also need to put a comma to the end of List 1, otherwise the last item won't be matched even if it's in the list
– phuclv
Jan 25 at 15:54
That's right - I put that in my earlier edit too! :-)
– JRI
Jan 25 at 18:17
add a comment |
I do not know how to automate your task in the Notepad++, but if your lists' data are not security critical, you can use script I have written in jsfiddle: https://jsfiddle.net/RomanTarasiuk/ev0fzsog/. Or save the script text into a *.html file and open it in your browser – this way is completely secure, and my script is as simple as possible and cannot damage your computer/smartphone.
Format each of your two lists that each of them are placed in one line, values in them are separated by comma only (no spaces). Put your two lists into first and second textarea accordingly and press button, and your result list will be placed to the third textarea.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1398099%2fnotepad-find-replace-etc%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You should be able to do this in Notepad++ as follows:
- Use a normal Find & Replace to replace all the commas in List 2 with
,|
, so you end up with a list of countries to delete likeCountry1,|Country2,|Country3,
. - Use this new list as the search term in a Regular Expression mode Find & Replace on List 1, with a blank as the replacement text.
Note that this assumes that country names are just separated by commas (no spaces). The last entry in List 1 should also be followed by a comma, otherwise it won't get matched by the search.
note thatCountry3
doesn't have a comma so you'll have a redundant comma where it was removed
– phuclv
Jan 25 at 3:10
Good spot @phuclv. I've updated my answer to correct this.
– JRI
Jan 25 at 9:11
you also need to put a comma to the end of List 1, otherwise the last item won't be matched even if it's in the list
– phuclv
Jan 25 at 15:54
That's right - I put that in my earlier edit too! :-)
– JRI
Jan 25 at 18:17
add a comment |
You should be able to do this in Notepad++ as follows:
- Use a normal Find & Replace to replace all the commas in List 2 with
,|
, so you end up with a list of countries to delete likeCountry1,|Country2,|Country3,
. - Use this new list as the search term in a Regular Expression mode Find & Replace on List 1, with a blank as the replacement text.
Note that this assumes that country names are just separated by commas (no spaces). The last entry in List 1 should also be followed by a comma, otherwise it won't get matched by the search.
note thatCountry3
doesn't have a comma so you'll have a redundant comma where it was removed
– phuclv
Jan 25 at 3:10
Good spot @phuclv. I've updated my answer to correct this.
– JRI
Jan 25 at 9:11
you also need to put a comma to the end of List 1, otherwise the last item won't be matched even if it's in the list
– phuclv
Jan 25 at 15:54
That's right - I put that in my earlier edit too! :-)
– JRI
Jan 25 at 18:17
add a comment |
You should be able to do this in Notepad++ as follows:
- Use a normal Find & Replace to replace all the commas in List 2 with
,|
, so you end up with a list of countries to delete likeCountry1,|Country2,|Country3,
. - Use this new list as the search term in a Regular Expression mode Find & Replace on List 1, with a blank as the replacement text.
Note that this assumes that country names are just separated by commas (no spaces). The last entry in List 1 should also be followed by a comma, otherwise it won't get matched by the search.
You should be able to do this in Notepad++ as follows:
- Use a normal Find & Replace to replace all the commas in List 2 with
,|
, so you end up with a list of countries to delete likeCountry1,|Country2,|Country3,
. - Use this new list as the search term in a Regular Expression mode Find & Replace on List 1, with a blank as the replacement text.
Note that this assumes that country names are just separated by commas (no spaces). The last entry in List 1 should also be followed by a comma, otherwise it won't get matched by the search.
edited Jan 25 at 9:10
answered Jan 24 at 22:46
JRIJRI
587316
587316
note thatCountry3
doesn't have a comma so you'll have a redundant comma where it was removed
– phuclv
Jan 25 at 3:10
Good spot @phuclv. I've updated my answer to correct this.
– JRI
Jan 25 at 9:11
you also need to put a comma to the end of List 1, otherwise the last item won't be matched even if it's in the list
– phuclv
Jan 25 at 15:54
That's right - I put that in my earlier edit too! :-)
– JRI
Jan 25 at 18:17
add a comment |
note thatCountry3
doesn't have a comma so you'll have a redundant comma where it was removed
– phuclv
Jan 25 at 3:10
Good spot @phuclv. I've updated my answer to correct this.
– JRI
Jan 25 at 9:11
you also need to put a comma to the end of List 1, otherwise the last item won't be matched even if it's in the list
– phuclv
Jan 25 at 15:54
That's right - I put that in my earlier edit too! :-)
– JRI
Jan 25 at 18:17
note that
Country3
doesn't have a comma so you'll have a redundant comma where it was removed– phuclv
Jan 25 at 3:10
note that
Country3
doesn't have a comma so you'll have a redundant comma where it was removed– phuclv
Jan 25 at 3:10
Good spot @phuclv. I've updated my answer to correct this.
– JRI
Jan 25 at 9:11
Good spot @phuclv. I've updated my answer to correct this.
– JRI
Jan 25 at 9:11
you also need to put a comma to the end of List 1, otherwise the last item won't be matched even if it's in the list
– phuclv
Jan 25 at 15:54
you also need to put a comma to the end of List 1, otherwise the last item won't be matched even if it's in the list
– phuclv
Jan 25 at 15:54
That's right - I put that in my earlier edit too! :-)
– JRI
Jan 25 at 18:17
That's right - I put that in my earlier edit too! :-)
– JRI
Jan 25 at 18:17
add a comment |
I do not know how to automate your task in the Notepad++, but if your lists' data are not security critical, you can use script I have written in jsfiddle: https://jsfiddle.net/RomanTarasiuk/ev0fzsog/. Or save the script text into a *.html file and open it in your browser – this way is completely secure, and my script is as simple as possible and cannot damage your computer/smartphone.
Format each of your two lists that each of them are placed in one line, values in them are separated by comma only (no spaces). Put your two lists into first and second textarea accordingly and press button, and your result list will be placed to the third textarea.
add a comment |
I do not know how to automate your task in the Notepad++, but if your lists' data are not security critical, you can use script I have written in jsfiddle: https://jsfiddle.net/RomanTarasiuk/ev0fzsog/. Or save the script text into a *.html file and open it in your browser – this way is completely secure, and my script is as simple as possible and cannot damage your computer/smartphone.
Format each of your two lists that each of them are placed in one line, values in them are separated by comma only (no spaces). Put your two lists into first and second textarea accordingly and press button, and your result list will be placed to the third textarea.
add a comment |
I do not know how to automate your task in the Notepad++, but if your lists' data are not security critical, you can use script I have written in jsfiddle: https://jsfiddle.net/RomanTarasiuk/ev0fzsog/. Or save the script text into a *.html file and open it in your browser – this way is completely secure, and my script is as simple as possible and cannot damage your computer/smartphone.
Format each of your two lists that each of them are placed in one line, values in them are separated by comma only (no spaces). Put your two lists into first and second textarea accordingly and press button, and your result list will be placed to the third textarea.
I do not know how to automate your task in the Notepad++, but if your lists' data are not security critical, you can use script I have written in jsfiddle: https://jsfiddle.net/RomanTarasiuk/ev0fzsog/. Or save the script text into a *.html file and open it in your browser – this way is completely secure, and my script is as simple as possible and cannot damage your computer/smartphone.
Format each of your two lists that each of them are placed in one line, values in them are separated by comma only (no spaces). Put your two lists into first and second textarea accordingly and press button, and your result list will be placed to the third textarea.
edited Jan 24 at 23:00
answered Jan 24 at 22:49
Roman TarasiukRoman Tarasiuk
173
173
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1398099%2fnotepad-find-replace-etc%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
don't put text in images. Paste a small sample so that people can try
– phuclv
Jan 25 at 3:08