1
00:00:00,120 --> 00:00:00,840
Hey, welcome back.

2
00:00:01,200 --> 00:00:04,680
In this video, we will replace this first line.

3
00:00:06,140 --> 00:00:13,430
With this I.D. with capital letters, Cuomo amount comma cost.

4
00:00:14,270 --> 00:00:19,790
So when we run the Python script, this line will be replaced to this text.

5
00:00:20,120 --> 00:00:20,870
Let's do this.

6
00:00:21,770 --> 00:00:24,800
Let's open merge that.

7
00:00:24,800 --> 00:00:31,370
See, as we file, that is a file that has to be changed in read mode first as file.

8
00:00:32,659 --> 00:00:36,620
And we get the contents file that's read the lines.

9
00:00:40,480 --> 00:00:47,740
So this method gives us a list of all the lines so that we can work on a line level.

10
00:00:48,740 --> 00:00:50,240
We've at least known.

11
00:00:52,120 --> 00:00:57,370
We see something like content zero equals two.

12
00:00:58,720 --> 00:01:03,220
That's shrink I.D. coma amount of cost.

13
00:01:04,360 --> 00:01:11,320
So what that does is this let's suppose we have this list a a sequel to a one to three.

14
00:01:11,950 --> 00:01:18,100
If you see the item within the zero has to be replaced with, let's say this.

15
00:01:19,530 --> 00:01:27,150
String, what you get is a list with this new item as the first item, the item with index zero.

16
00:01:27,300 --> 00:01:28,800
So that is what we're doing here.

17
00:01:29,190 --> 00:01:35,100
And then you open the file again in right mo this time.

18
00:01:40,180 --> 00:01:48,190
And you can use roids lines and just pass content there, the list.

19
00:01:48,520 --> 00:01:49,960
So this is one way to do it.

20
00:01:50,230 --> 00:01:57,610
You run that merge that see us view now has these new content with this new line.

21
00:01:58,510 --> 00:02:02,380
But we forgot to add a backslash here, so let me run again.

22
00:02:06,010 --> 00:02:07,240
Yeah, now it looks fine.

23
00:02:08,050 --> 00:02:15,340
So that is one way to do it the other way, which I think it would be unnecessary would be to convert

24
00:02:15,340 --> 00:02:23,590
to the least into a string using the joint methods which we used in the previous video of then use rides

25
00:02:23,710 --> 00:02:26,730
to ride the string in the file.

26
00:02:27,460 --> 00:02:32,880
So rides, who works with strings and writes lines, works with lists.

27
00:02:32,890 --> 00:02:37,180
So this is a list that is the equivalent of read lines.

28
00:02:37,960 --> 00:02:40,770
So that's completes this vigil.

29
00:02:41,170 --> 00:02:41,670
Thank you.

30
00:02:41,680 --> 00:02:42,870
And let's do some more.

