You are here: PSPad forum > English discussion forum > delete all lines not beginning with a predefined string
Posted by: Esgrimidor | Date: 2018-01-13 14:52 | IP: IP Logged
how can i delete all lines except those beginning with a determined string. By example : Delete all lines except those beginning with "5234534".
Any equivalent task may help me like extract the lines beginning with a certain sring to a new file.
Best Regards
--
Nice program indeed
Posted by: pspad | Date: 2018-01-13 20:00 | IP: IP Logged
Use search functionality
Search for line containing your string, check Non matched lines and press COPY buttton
Into new file will be copied content what doesn't match
If you want lines, starting for some exact expression, use regular expression
Search for: ^5234534.*
[x]Regular expression
[x]Copy nonmatching + COPY button
You can use another way - empty lines you don't want with search/replace:
Search: ^5234534.*
Replace: (empty)
[x]Regular expressions
Followed by function to remove empty lines from menu Edit / Line manipulation
Posted by: Esgrimidor | Date: 2018-01-20 20:32 | IP: IP Logged
Thanks a lot !!!!!
Best Regards
--
Nice program indeed
Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR