reg-ex to clean txt file
-
@cisco779k
Why not convert all spaces to newlines. Then bookmark all lines with http. Then remove all non bookmarked lines.Terry
-
After Terry’s suggestion, you may want to execute this replacement operation:
Find:
(?-is)^.+?(?=https:)
Replace: nothing
Search mode: Regular expressionto remove what occurs before
https
on your lines. -
@ Terry
thanks for your reply, but not easy for me follow your suggestion. you can provide and example?
or you talk about Edit - Line operations - Remove empty Lines ?@ Alan
thanks also for your reply. your regex can work. i need only to understand the first step … -
Oops. Terry’s suggestion will work, without my add-on.
-
Terry’s solution involves:
Find:
\x20
Replace:\r\n
Search mode: Regular expressionThen, Search menu > Mark with Find:
https
.Then Search menu > Bookmark > Remove Non-Bookmarked Lines.
-
@Alan-Kilborn
Just an addendum to this solution: it won’t work unless you checkBookmark line
on theMark
menu, because that is not checked by default. -
@Mark-Olson said in reg-ex to clean txt file:
Just an addendum to this solution: it won’t work unless you check Bookmark line on the Mark menu
Yep, for sure, meant to mention that…I just didn’t. :-)
Thanks for picking me up. -
oh yes Alan, your tip work like a charm
and thanks also to Mark Olson for your clarification -
i’ve saved all steps to new macro, and this work fine.
also i’ve noticed that the macro is saved on shortcuts.xml file.
I wonder if you can save the macro to a separate file … (to not to forget it in the future) -
Firstly, you have been a member of this forum since August 2017, so at least 5 years. You have asked a number of regex related questions and received answers in all cases.
You have been requested to start learning regex, see here, that was over 2 years ago, yet you still don’t appear to have learnt even the basics.
I supplied my solution last night via a smartphone, hence the shortness of the post. But I at least expected you to understand how to use that to solve your question.
I must say you appear to have been lucky in getting so many solutions. Normally we request users in your position to have at least tried to figure out an answer. Then present us with what you tried.
How about trying to learn now!
Terry
-
… useless polemic …
on my first post, i’ve ask help for a regex to my trouble. very hard for me.
maybe i would have at this solution on my own
(but thanks anyway to Alan for your support) -
@cisco779k said in reg-ex to clean txt file:
but thanks anyway to Alan for your support
You’re welcome but I agree with Terry.
You need to start learning how to do such things.
For some reason I didn’t check your posting history before contributing thoughts to this thread. -
@cisco779k ,
You seem to have quite a vocabulary for a non-english speaker, so try using your intelligence for learning regex, rather than crying for help and using $20.00 word swipes at the volunteers, who I wouldn’t blame for letting your posts die from neglect from here on out. And yes, polemic fits this post just fine.