In this video, I'll write a script which replaces the words amount to the words units in all of the
files within the files folder.
So let's do that again.
We will use the path class and we create a file directory path object.
And then we iterate over that directory for file path and files the 8.0.
We open the file path.
The file path in Reid's modes as file and store the contents in a content variable using the reid's
methods.
The new content now is content DOT replays.
You want to replace amounts with.
Units, so replace some methods of strings, as you can see with Dear Steve, or you see that to replace
is right here.
So it gets a first argument and the second argument and the second argument will replace the first arguments
in that string content string.
And then we open a new file so we on indent and then in the same indentation level with a previous if
we write another eve with open file path in.
Write more this time as file file that writes new content goes in here run.
And check, so we have unions for the first of all, the unions for the second one, units for the third
one, and that is the complete code.
Thank you for following this.
Let's have some more videos suing the next one.