0
votes

I have a relatively big Word document containing Tweets. I now want to replace all links in that file. Every link starts with http, is there a possibility to find all words that start with http but then delete the whole word/link?

I have tried using the search and replace option but I couldn't find a solution.

Any help is much appreciated!

2
This would seem off-topic for the stack overflow forum. stackoverflow.com/help/on-topic More appropriate would be posting in superuser.com/questions/tagged/microsoft-word - or - msofficeforums.com/word - or - answers.microsoft.com/en-us/msoffice/forum/…Charles Kenyon

2 Answers

0
votes

You could use python to process the entire file, I would advise creating a second file where you storage the result. A little code that should do what you want.

with open("filename", 'r') as f:
    content = f.read()

words = content.split(" ")

filtered_word = [word for word in words if not word.startswith("http")]

content = " ".join(filtered_word)

with open("filename_result", 'w') as f:
    f.write(content)
0
votes

I found an answer: I first used the iOS Version of Word but there I couldn't use wildcards. Now I used a Windows version of Word and through the search and replace option I used "http*" to search for all links.