We'd like to remind Forumites to please avoid political debate on the Forum... Read More »
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
Remove text in brackets from a text file?
Options

facade
Posts: 7,601 Forumite


in Techie Stuff
So I have some text files that have (text in brackets) I want to delete all instances of these, including what is inside the bracket.
e.g
(Billy) What time is it?
(Julie) Quarter to three. (looks at clock)No, ten to
becomes
What time is it?
Quarter to three. No, ten to
Anything free that will do it?
I have textpad, notepad+ & libreoffice.
I searched and there are a few articles on removing square brackets text, but swapping the square bracket for curved ones doesn't work.
I thought I had it cracked with use regular expressions and "(.*)" but that successfully found everything and deleted it brackets or not
I want to go back to The Olden Days, when every single thing that I can think of was better.....
(except air quality and Medical Science
)
(except air quality and Medical Science

0
Comments
-
Easiest solution i can think of is power renamer ... part of windows powerwtoys.
https://learn.microsoft.com/en-us/windows/powertoys/
https://learn.microsoft.com/en-us/windows/powertoys/powerrename
1 -
In notepad++ and similar you have to escape the special characters when doing a regular expression search
so it’ll probably be something like this /(.*/)
if it’s not / try the other slash.PPI success. Banding success. Double Dip PCN cancelled! South facing solar (Midlands) and battery. Savings Session supporter (is it worth it now!?)1 -
Bradden said:Easiest solution i can think of is power renamer ... part of windows powerwtoys.
https://learn.microsoft.com/en-us/windows/powertoys/
https://learn.microsoft.com/en-us/windows/powertoys/powerrename
I have power renamer, I use it all the time, but these aren't filenames, it is text inside the file
I want to go back to The Olden Days, when every single thing that I can think of was better.....
(except air quality and Medical Science)
1 -
pete-20-11 said:In notepad++ and similar you have to escape the special characters when doing a regular expression search
so it’ll probably be something like this /(.*/)
if it’s not / try the other slash.Thanks, the regular expression \(.*\) sort of worked in notepad++, it found and eliminated about half of them.It refuses to find the rest!I wondered if they were double width characters or something but regular search for ( finds them ok...I can find ( and then manually delete the rest but there are hundreds, and more than 1 file to do.Success!The program that generated the file in the first place (subtitle edit) does work if I use the regular expression \(.*\) in the editor.In fact it has a multiple find & replace that mixes text and regular expressions so I can eliminate all bracket text (SDH comments) and squiggle note (music is playing) in one pass.Thanks for the help.
I want to go back to The Olden Days, when every single thing that I can think of was better.....
(except air quality and Medical Science)
1 -
Subtitle Edit is excellent. As well as the Multiple Replace it also has Tools - Remove Text for Hearing Impaired, which does exactly what you're trying to do with one click.1
-
fenlander_uk said:Subtitle Edit is excellent. As well as the Multiple Replace it also has Tools - Remove Text for Hearing Impaired, which does exactly what you're trying to do with one click.So it does!I'd never read that far down Tools, but I suppose it is obvious that everyone would want thatI've used it to convert Chinese PGS subtitles into passable English srt, which is pretty amazing really.I'm trying out out the speech to text right now!
I want to go back to The Olden Days, when every single thing that I can think of was better.....
(except air quality and Medical Science)
0 -
OCR to convert DVB subtitles to .srt is good, too. You need to have Tesseract OCR installed.And check out the options under 'Fix common errors' - very useful.1
-
My clickbait feed on youtube is now suggesting videos on how to do this.Proof (if we needed it) that any search done with google is captured to my profile and used across the platform.Default search engine now set to duckduckgo.I want to go back to The Olden Days, when every single thing that I can think of was better.....
(except air quality and Medical Science)
0 -
Gave up on Google search ages ago. Trying to find historic data for a building and a village but all it kept feeding me was
clickbait articles from a recent incident in the village.
All local newspapers seemingly now only exists as online advert platforms to regurgitate the same error strewn non news articles.
2 short lines of text and then 10 pages of clickbait adverts...
over 70 claim all your tax back, you wont believe how much this cost, cars being given away for almost free... Do people really click
that rubbish and expect an ounce of truth?Censorship Reigns Supreme in Troll City...0
Confirm your email address to Create Threads and Reply

Categories
- All Categories
- 351.1K Banking & Borrowing
- 253.1K Reduce Debt & Boost Income
- 453.6K Spending & Discounts
- 244.1K Work, Benefits & Business
- 599K Mortgages, Homes & Bills
- 177K Life & Family
- 257.4K Travel & Transport
- 1.5M Hobbies & Leisure
- 16.1K Discuss & Feedback
- 37.6K Read-Only Boards