User: roger -- 2017-12-10 << 1408 1410 >> |
Hits: 2678 |
Type: Advanced search and replace |
Search all Advanced search and replace examples |
Description: |
How to highlight words appeared in same line in another file? I have two files which are 1-1 matched. It means, in sentences.txt each sentence must contain a word from the words.txt file and they match in lines. but I only need to highlight (put a {} around) the exact word which is also at the same numbered line. |
Input Sample: |
file words.txt: book books booking booked bookcase bookcases booking bookings file sentences.txt: I have recently bought some books. The new bookcase is beautiful with all these books. I need to update my bookings |
Output Sample: |
sentences-highlight.txt I have recently bought some {books}. The new {bookcase} is beautiful with all these books. I need to update my {bookings}. |
Answer: |
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
1. put words.txt in d:\test\ folder 2. ctrl-o open sentences.txt * set 'search' to: * set 'replace' to: * set 'if' to: 3. click 'replace', done. 4. ctrl-s save to sentences-highlight.txt. |
Screenshot 1: Replace_Window |
Similar Examples: |
How to replace each xxx with the first word in the same line in text file? (60%) How to count number of words appeared in a text file? (59%) How to replace the quoted text with lines from another file? (58%) How to replace some text with a random line from another file? (58%) How to add words at the begin and end of first line in multiple files? (57%) How to delete the first word in each line in a text file? (56%) How to count and sort the frequency of all words appeared in many text files? (54%) How to replace all words "NAME" in a file to different names listed in another file in sequence? (54%) |
Check Demo of Advanced search and replace |
Keywords: |
global exact round sentences sentence two files another file two same test same words in two files replace words in a sentence sentences contain the word replace words are the same replace sentences lines contain words two words two lines |