Read, Search and Substitute problem

Greetings to all,

I’m new in the comunity so pardon my lack of experience…I’ve stumbled upon the following problem in which I need from you guys some light on how to build the code:

The code must:

  • read a .txt file
  • track two differents combination of algarisms which follows a same number
  • leave the following number with only 4 numbers after the decimal separator point.

Example:
We search for the strings “VunTrib” and “VunCom”
The code reads the .txt file with the following content:

VUnTrib65.5633333333
randomwordsinsidethetext123456789
VunCom65.5633333333

The output should be:

VUnTrib65.5633
randomwordsinsidethetext123456789
VunCom65.5633

*Notice that the searched string may appear many times in the text with different numbers to be adjusted to only 4 decimal numbers.
*If the number has less than 4 decimal numbers, there’s no need to be adjusted.
*I accept suggestions of writing this code in other languages apart from C++

Thanks in advance for whoever is willing to help!