NotePad ++ : Delete characters before and after specific string
-rw-rw-r-- 1 pstambia pstambia 131721 Apr 9 2018 DPT_p_EXT_CONTRACT.deliv
-rw-rw-r-- 1 pstambia pstambia 122364 Nov 28 22:56 DPT_p_EXT_CRC.deliv
-rw-rw-r-- 1 pstambia pstambia 137893 Apr 9 2018 DPT_p_EXT_CRENGLOG.deliv
-rw-r--r-- 1 pstambia pstambia 120692 Oct 29 09:36 DPT_p_EXT_COLLQ4.deliv
-rw-r--r-- 1 pstambia pstambia 118732 Oct 29 09:36 DPT_p_EXT_COLLQ5B.deliv
Finally i want to keep only
-rw-rw-r-- 1 pstambia pstambia 131721 Apr 9 2018
notepad
add a comment |
-rw-rw-r-- 1 pstambia pstambia 131721 Apr 9 2018 DPT_p_EXT_CONTRACT.deliv
-rw-rw-r-- 1 pstambia pstambia 122364 Nov 28 22:56 DPT_p_EXT_CRC.deliv
-rw-rw-r-- 1 pstambia pstambia 137893 Apr 9 2018 DPT_p_EXT_CRENGLOG.deliv
-rw-r--r-- 1 pstambia pstambia 120692 Oct 29 09:36 DPT_p_EXT_COLLQ4.deliv
-rw-r--r-- 1 pstambia pstambia 118732 Oct 29 09:36 DPT_p_EXT_COLLQ5B.deliv
Finally i want to keep only
-rw-rw-r-- 1 pstambia pstambia 131721 Apr 9 2018
notepad
1
Your example does not match your title: please clarify.
– AFH
Jan 21 at 17:42
Do you want to keep only 1 line or all the lines without filename?
– Toto
Jan 21 at 17:45
You copied this from a Linux/Unix machine into Notepad++ and you want to delete the filenames from Notepad++?
– Manuel Florian
Jan 21 at 17:53
add a comment |
-rw-rw-r-- 1 pstambia pstambia 131721 Apr 9 2018 DPT_p_EXT_CONTRACT.deliv
-rw-rw-r-- 1 pstambia pstambia 122364 Nov 28 22:56 DPT_p_EXT_CRC.deliv
-rw-rw-r-- 1 pstambia pstambia 137893 Apr 9 2018 DPT_p_EXT_CRENGLOG.deliv
-rw-r--r-- 1 pstambia pstambia 120692 Oct 29 09:36 DPT_p_EXT_COLLQ4.deliv
-rw-r--r-- 1 pstambia pstambia 118732 Oct 29 09:36 DPT_p_EXT_COLLQ5B.deliv
Finally i want to keep only
-rw-rw-r-- 1 pstambia pstambia 131721 Apr 9 2018
notepad
-rw-rw-r-- 1 pstambia pstambia 131721 Apr 9 2018 DPT_p_EXT_CONTRACT.deliv
-rw-rw-r-- 1 pstambia pstambia 122364 Nov 28 22:56 DPT_p_EXT_CRC.deliv
-rw-rw-r-- 1 pstambia pstambia 137893 Apr 9 2018 DPT_p_EXT_CRENGLOG.deliv
-rw-r--r-- 1 pstambia pstambia 120692 Oct 29 09:36 DPT_p_EXT_COLLQ4.deliv
-rw-r--r-- 1 pstambia pstambia 118732 Oct 29 09:36 DPT_p_EXT_COLLQ5B.deliv
Finally i want to keep only
-rw-rw-r-- 1 pstambia pstambia 131721 Apr 9 2018
notepad
notepad
edited Jan 21 at 17:40
AFH
14.2k31938
14.2k31938
asked Jan 21 at 17:35
JulianaJuliana
1
1
1
Your example does not match your title: please clarify.
– AFH
Jan 21 at 17:42
Do you want to keep only 1 line or all the lines without filename?
– Toto
Jan 21 at 17:45
You copied this from a Linux/Unix machine into Notepad++ and you want to delete the filenames from Notepad++?
– Manuel Florian
Jan 21 at 17:53
add a comment |
1
Your example does not match your title: please clarify.
– AFH
Jan 21 at 17:42
Do you want to keep only 1 line or all the lines without filename?
– Toto
Jan 21 at 17:45
You copied this from a Linux/Unix machine into Notepad++ and you want to delete the filenames from Notepad++?
– Manuel Florian
Jan 21 at 17:53
1
1
Your example does not match your title: please clarify.
– AFH
Jan 21 at 17:42
Your example does not match your title: please clarify.
– AFH
Jan 21 at 17:42
Do you want to keep only 1 line or all the lines without filename?
– Toto
Jan 21 at 17:45
Do you want to keep only 1 line or all the lines without filename?
– Toto
Jan 21 at 17:45
You copied this from a Linux/Unix machine into Notepad++ and you want to delete the filenames from Notepad++?
– Manuel Florian
Jan 21 at 17:53
You copied this from a Linux/Unix machine into Notepad++ and you want to delete the filenames from Notepad++?
– Manuel Florian
Jan 21 at 17:53
add a comment |
1 Answer
1
active
oldest
votes
With Notepad++, if you want to delete filenames from each line:
Ctrl+H
- Find what:
h+S+$
- Replace with:
LEAVE EMPTY
- check Wrap around
- check Regular expression
- Replace all
Explanation:
h+ # 1 or more horizontal spaces
S+ # 1 or more non space characters
$ # end of line
Result for given example:
-rw-rw-r-- 1 pstambia pstambia 131721 Apr 9 2018
-rw-rw-r-- 1 pstambia pstambia 122364 Nov 28 22:56
-rw-rw-r-- 1 pstambia pstambia 137893 Apr 9 2018
-rw-r--r-- 1 pstambia pstambia 120692 Oct 29 09:36
-rw-r--r-- 1 pstambia pstambia 118732 Oct 29 09:36
This approach works but take care if you clickReplace All
more than once because it would keep removing the last column. To avoid this you can replace the Find what: withDPT.*.deliv$
.
– Manuel Florian
Jan 21 at 19:29
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%2f1396711%2fnotepad-delete-characters-before-and-after-specific-string%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
With Notepad++, if you want to delete filenames from each line:
Ctrl+H
- Find what:
h+S+$
- Replace with:
LEAVE EMPTY
- check Wrap around
- check Regular expression
- Replace all
Explanation:
h+ # 1 or more horizontal spaces
S+ # 1 or more non space characters
$ # end of line
Result for given example:
-rw-rw-r-- 1 pstambia pstambia 131721 Apr 9 2018
-rw-rw-r-- 1 pstambia pstambia 122364 Nov 28 22:56
-rw-rw-r-- 1 pstambia pstambia 137893 Apr 9 2018
-rw-r--r-- 1 pstambia pstambia 120692 Oct 29 09:36
-rw-r--r-- 1 pstambia pstambia 118732 Oct 29 09:36
This approach works but take care if you clickReplace All
more than once because it would keep removing the last column. To avoid this you can replace the Find what: withDPT.*.deliv$
.
– Manuel Florian
Jan 21 at 19:29
add a comment |
With Notepad++, if you want to delete filenames from each line:
Ctrl+H
- Find what:
h+S+$
- Replace with:
LEAVE EMPTY
- check Wrap around
- check Regular expression
- Replace all
Explanation:
h+ # 1 or more horizontal spaces
S+ # 1 or more non space characters
$ # end of line
Result for given example:
-rw-rw-r-- 1 pstambia pstambia 131721 Apr 9 2018
-rw-rw-r-- 1 pstambia pstambia 122364 Nov 28 22:56
-rw-rw-r-- 1 pstambia pstambia 137893 Apr 9 2018
-rw-r--r-- 1 pstambia pstambia 120692 Oct 29 09:36
-rw-r--r-- 1 pstambia pstambia 118732 Oct 29 09:36
This approach works but take care if you clickReplace All
more than once because it would keep removing the last column. To avoid this you can replace the Find what: withDPT.*.deliv$
.
– Manuel Florian
Jan 21 at 19:29
add a comment |
With Notepad++, if you want to delete filenames from each line:
Ctrl+H
- Find what:
h+S+$
- Replace with:
LEAVE EMPTY
- check Wrap around
- check Regular expression
- Replace all
Explanation:
h+ # 1 or more horizontal spaces
S+ # 1 or more non space characters
$ # end of line
Result for given example:
-rw-rw-r-- 1 pstambia pstambia 131721 Apr 9 2018
-rw-rw-r-- 1 pstambia pstambia 122364 Nov 28 22:56
-rw-rw-r-- 1 pstambia pstambia 137893 Apr 9 2018
-rw-r--r-- 1 pstambia pstambia 120692 Oct 29 09:36
-rw-r--r-- 1 pstambia pstambia 118732 Oct 29 09:36
With Notepad++, if you want to delete filenames from each line:
Ctrl+H
- Find what:
h+S+$
- Replace with:
LEAVE EMPTY
- check Wrap around
- check Regular expression
- Replace all
Explanation:
h+ # 1 or more horizontal spaces
S+ # 1 or more non space characters
$ # end of line
Result for given example:
-rw-rw-r-- 1 pstambia pstambia 131721 Apr 9 2018
-rw-rw-r-- 1 pstambia pstambia 122364 Nov 28 22:56
-rw-rw-r-- 1 pstambia pstambia 137893 Apr 9 2018
-rw-r--r-- 1 pstambia pstambia 120692 Oct 29 09:36
-rw-r--r-- 1 pstambia pstambia 118732 Oct 29 09:36
answered Jan 21 at 17:56
TotoToto
3,798101226
3,798101226
This approach works but take care if you clickReplace All
more than once because it would keep removing the last column. To avoid this you can replace the Find what: withDPT.*.deliv$
.
– Manuel Florian
Jan 21 at 19:29
add a comment |
This approach works but take care if you clickReplace All
more than once because it would keep removing the last column. To avoid this you can replace the Find what: withDPT.*.deliv$
.
– Manuel Florian
Jan 21 at 19:29
This approach works but take care if you click
Replace All
more than once because it would keep removing the last column. To avoid this you can replace the Find what: with DPT.*.deliv$
.– Manuel Florian
Jan 21 at 19:29
This approach works but take care if you click
Replace All
more than once because it would keep removing the last column. To avoid this you can replace the Find what: with DPT.*.deliv$
.– Manuel Florian
Jan 21 at 19:29
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%2f1396711%2fnotepad-delete-characters-before-and-after-specific-string%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
1
Your example does not match your title: please clarify.
– AFH
Jan 21 at 17:42
Do you want to keep only 1 line or all the lines without filename?
– Toto
Jan 21 at 17:45
You copied this from a Linux/Unix machine into Notepad++ and you want to delete the filenames from Notepad++?
– Manuel Florian
Jan 21 at 17:53