We'd like to remind Forumites to please avoid political debate on the Forum... Read More »
Any Word experts around?



I've been sent a list of items. Each item ends with a code in the
format (XXX..) 123..., because of this when I try to import it into my
system it errors as the code isn't needed (bad programming, I know).
The code string is a variable length.
The list looks like this 'Item Thing (xy-z) ab123' I need to remove the leading ( and everything after it on the line.
Is there some way to use search and replace to remove the code and everything after it on the line?
I was thinking of something like 'search (*' and then Replace with .
But that just throws up a Word error, 'No results found'!
I'm using Word Pro Plus 2019
Comments
-
It’s possible to create a table from text in Word, where the column breaks are determined by a specific character. I don’t know if that works in your version of Word as I use a different one. Once you have the data in columns it’s easier to delete specific sections of strings. If you don’t want your data in a table you can replace your deleted text with a new character and then ‘find > replace’ to substitute a tab.Fashion on the Ration
2024 - 43/66 coupons used, carry forward 23
2025 - 60.5/890 -
What format is the file?Life in the slow lane0
-
Thinking along the lines as born_again I think regarding file import!!However the find and replace ( rather than "search") is most flexible when done in Word VBA (but shaort of time just at the mo!Far easier if it is a text or CSV file (or to save it as such) to import it into Excel (setting appropriate delimiters) which will put it all into columns and then just delete all the columns including "(" and after.[maybe can be imported similarly into word and also delete the columns??? nt something I am familiar with in the later versions of Word...]0
-
For future reference, this is the sort of problem that ChatGPT is good at solving. Particularly as you can show it a sample of real data. It’s very good at making short programs, if you want to start learning to program.
No reliance should be placed on the above! Absolutely none, do you hear?1 -
Convert to table with ( as a delimiter is probably the quickest way. Then just copy the text from the column you want to keep and paste as keeping the text only.
Should take les than a minute and no messing with VBA or anything.
If it is a CSV file, then do it in Excel through import data.1 -
To remove everything starting from the first opening parenthesis
(
and everything after it, you can use Word's Find and Replace feature with wildcards enabled. Here's how to do it:Open the Find and Replace dialog:
- Press
Ctrl + H
to open the Find and Replace dialog box.
- Press
Enable wildcards:
- Click on More (if not already expanded).
- Check the box labeled Use wildcards.
Set up the search pattern:
- In the Find what box, enter
\(.*$
- Explanation:
\(
matches the literal opening parenthesis(
..*
matches any characters (zero or more times) until the end of the line.$
matches the end of the line.
- Explanation:
- Leave the Replace with box empty to remove everything matched.
- In the Find what box, enter
Run the replacement:
- Click Replace All.
1 -
Vitor said:
To remove everything starting from the first opening parenthesis
(
and everything after it, you can use Word's Find and Replace feature with wildcards enabled. Here's how to do it:Open the Find and Replace dialog:
- Press
Ctrl + H
to open the Find and Replace dialog box.
- Press
Enable wildcards:
- Click on More (if not already expanded).
- Check the box labeled Use wildcards.
Set up the search pattern:
- In the Find what box, enter
\(.*$
- Explanation:
\(
matches the literal opening parenthesis(
..*
matches any characters (zero or more times) until the end of the line.$
matches the end of the line.
- Explanation:
- Leave the Replace with box empty to remove everything matched.
- In the Find what box, enter
Run the replacement:
- Click Replace All.
Thank you for that. .. But, I've followed it step by step, tried cut and pasting it and entering it and all I get is 'No Results Found'?
0 -
Might be the version of word you are using. Certainly Find and Reaplace has improved over the yearsMy old version would not accept the above method.However if yours is not producing an error message ( rather than not finding the search string ) it suggests something there does not match but that could still be the interpretation of the search string.Not sure of the versions Vitors solution works with, maybe you will get a post to let you know. You can always use 365 ( for free ) if your version is not recent.Further the use of a backslash can sometimes be problematic ( no idea why!) but the best info I have ever found regarding Find is on a website that might be useful to read at
1 -
Use find & replace to change "(" to "^t" (tab). This has worked since the very early versions of Word.
You can then change your text to a table and Word should split the lines at the Tab mark.1 -
Any reason why you aren't doing this in Excel?0
Confirm your email address to Create Threads and Reply

Categories
- All Categories
- 349.6K Banking & Borrowing
- 252.5K Reduce Debt & Boost Income
- 452.9K Spending & Discounts
- 242.5K Work, Benefits & Business
- 619.2K Mortgages, Homes & Bills
- 176.3K Life & Family
- 255.4K Travel & Transport
- 1.5M Hobbies & Leisure
- 16.1K Discuss & Feedback
- 15.1K Coronavirus Support Boards