NotePad ++ : Delete characters before and after specific string












0















-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 









share|improve this question




















  • 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
















0















-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 









share|improve this question




















  • 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














0












0








0








-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 









share|improve this question
















-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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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














  • 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










1 Answer
1






active

oldest

votes


















0














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





share|improve this answer
























  • 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













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
});


}
});














draft saved

draft discarded


















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









0














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





share|improve this answer
























  • 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


















0














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





share|improve this answer
























  • 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
















0












0








0







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





share|improve this answer













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






share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 21 at 17:56









TotoToto

3,798101226




3,798101226













  • 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



















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




















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

Mangá

Eduardo VII do Reino Unido