WEBVTT 00:00.300 --> 00:00.930 They'll come back. 00:00.930 --> 00:06.810 So you were only writing and appending findings in this lecture let us talk about how to read content 00:06.810 --> 00:07.850 from our filing. 00:08.100 --> 00:13.910 So I don't know why find I did some guidance and this is my right in the same exact directory. 00:14.370 --> 00:20.740 So I have some line of code you are reading lie number one and then fall into line in my day. 00:21.060 --> 00:28.470 So I need to write that all to read these objects in print in my own format or print some selected words 00:28.560 --> 00:29.730 or leave it list. 00:29.730 --> 00:30.880 We'll be doing that. 00:31.080 --> 00:33.990 So remember to read while we need to use on. 00:34.140 --> 00:40.410 And the second thing is we have to follow some structure or bonafied we did do some our task and then 00:40.410 --> 00:45.800 close it so we can use either one or the variable file handler matter. 00:45.800 --> 00:55.700 It was my FH then open then my finding and then my modem that's done now I have open my files. 00:55.760 --> 01:04.270 I can read it with the help of my mentor use your file handler then read that stuff and like. 01:04.370 --> 01:06.720 Close things no question. 01:06.970 --> 01:11.740 I've been using monologist window of time because it would be hard to bring everything here. 01:11.750 --> 01:14.870 I just need to drag this up and down every time. 01:14.870 --> 01:16.140 So let me minimize this. 01:16.140 --> 01:25.630 I open my almoner head of my terminal to get a decree and just run this one. 01:25.660 --> 01:27.360 You see I haven't got any of those. 01:27.420 --> 01:27.950 Why. 01:28.050 --> 01:33.560 Because I haven't looked in but it is stored in this particular object only. 01:33.750 --> 01:39.370 So either I need to print this object or store that in many it will do something with that. 01:39.660 --> 01:42.620 In this one in my domino 01:45.410 --> 01:48.170 log got my result that I was expecting. 01:48.410 --> 01:55.850 So after completing my read is actually gaining all the funding that is available in my day or XTi. 01:56.380 --> 02:02.680 But what if I just need to get my first name or my first character so he can do that. 02:02.780 --> 02:10.900 So if I pass 3 that means it will give me a result not starting 3 character let me wrong this one had 02:12.630 --> 02:15.140 you see is all you. 02:15.280 --> 02:20.040 Let me try this one again. 02:22.720 --> 02:24.560 Now what you're seeing is a result. 02:24.760 --> 02:27.480 We are getting results from you and then something. 02:27.480 --> 02:30.210 Is that just because of wind. 02:30.460 --> 02:37.310 When the first line the first read we left after three characters and Apodaca. 02:37.620 --> 02:42.260 Secondly we started from Despoina and then read our characters. 02:42.290 --> 02:48.910 So it is exactly space then three then space that is our total 5 and then read. 02:48.960 --> 02:50.250 I that is 5. 02:50.560 --> 02:52.750 So that's how we are foiling point. 02:52.840 --> 02:55.020 And that is why it is really important. 02:55.240 --> 02:57.900 So that's where I need to focus on. 02:57.910 --> 03:01.450 Let us use more amateurs that are related to read. 03:01.450 --> 03:03.800 We have tried reading our characters. 03:03.820 --> 03:07.710 The second thing is you can use read line. 03:07.870 --> 03:11.130 Does it actually give you the result of that by or line. 03:11.180 --> 03:14.100 Or you can point to let me in on this one. 03:15.140 --> 03:20.240 U.S.-Arab are the result of you and the remaining thing that was available in my line. 03:20.450 --> 03:23.080 Let me remove this one. 03:23.150 --> 03:25.700 Now my window will be at the starting line. 03:25.720 --> 03:30.560 This one again I got my first name as my design. 03:30.770 --> 03:31.770 Things look fine. 03:31.910 --> 03:34.560 What if I tried to print this for several times 03:38.690 --> 03:40.250 on this one again. 03:40.280 --> 03:47.830 You see my point though is wanting that so that one can bring each line if I need to print lines. 03:47.840 --> 03:49.380 You can also do that. 03:49.530 --> 03:51.370 You can use lines. 03:51.420 --> 03:54.770 It was done on rezoned off list. 03:54.830 --> 03:57.010 Let me run this one. 03:57.010 --> 04:03.010 You see I got everything in my list and then less I can use my indexing. 04:03.020 --> 04:11.610 So if I print zero now and the list Ysleta is converted into one element of let's see if I print index 04:11.660 --> 04:19.420 0 That means our first line if I print the next one that is my second line with that name will Randhir 04:21.060 --> 04:27.970 You see I'm printing my index 0 and I got the result off last line so easily and is converted into one 04:28.060 --> 04:30.650 element of list and I can play with that. 04:30.760 --> 04:36.480 So all the metal that was applicable on my list will be APIC Even now I can do a split. 04:36.520 --> 04:49.920 I can check out its land on the Google element set up in my list right then if I boss my next move that 04:49.940 --> 04:55.400 is maybe my first name then it will give me the length of that line. 04:57.000 --> 04:58.660 That is 23. 04:58.830 --> 05:03.130 You can play in this and you can also play it fires all day. 05:03.150 --> 05:08.090 The next thing I want to talk about is what if I dig for a loop as an example again. 05:08.490 --> 05:17.380 So just move this one the. 05:17.570 --> 05:23.340 Nothing is going to happen because I just one more time I'm not a good ending line from my object. 05:23.340 --> 05:27.050 That is my final hand to me on this one. 05:27.450 --> 05:32.880 I got my hands on it so I'm printing my line with the help on this issue. 05:32.940 --> 05:36.960 So the first line and the second line and then the fault line. 05:37.120 --> 05:43.520 I can also apply split that give the character by which I need to split down. 05:43.670 --> 05:45.070 Let me give us peace. 05:45.090 --> 05:49.690 Not all of them but I'm going to get a result in the form of missed this one. 05:49.820 --> 05:50.850 I got my list. 05:50.900 --> 05:54.430 I can't even find the lid on afterwards Fossilman and 05:57.480 --> 06:04.830 this one in Iraq is old of five as the number of elements that are present in that list. 06:04.830 --> 06:06.000 So that's how you can play. 06:06.000 --> 06:08.480 You can also do one great thing. 06:08.580 --> 06:13.410 You can read from one file and then write another if I want to do that. 06:13.440 --> 06:14.020 Notice to 06:16.840 --> 06:24.760 see how fast file object in my file and French I will create a second one as you and I would open a 06:24.810 --> 06:25.750 second. 06:26.030 --> 06:30.300 I would get a name of this store text and then I will boss. 06:30.310 --> 06:31.550 All right. 06:31.880 --> 06:38.520 Now what I have to do is I need to read from them would be XTi and now I'm writing into my stock B XTi. 06:38.690 --> 06:40.940 Let me try that with only one lane 06:48.020 --> 06:52.270 so we get that as our exit. 06:52.360 --> 06:55.030 You did check out my desk. 06:55.060 --> 06:56.050 Darby XTi. 06:56.130 --> 06:58.230 You see I got my first line. 06:58.550 --> 07:00.940 Now you can play with dad all day long. 07:01.140 --> 07:03.870 So that's how we can play with different files. 07:04.150 --> 07:06.620 We are going to pick different result. 07:06.690 --> 07:14.140 What I have been had is I just used a good deal or tried that means I'm using file enough love for desktop. 07:14.460 --> 07:21.870 And using my fine hand for more or extempore reading and writing in my case the one thing you need to 07:21.870 --> 07:24.480 know is that I miss out the door. 07:25.890 --> 07:29.440 And also remember we can use that second letter with the help of. 07:29.850 --> 07:32.490 So I could not understand the whole file handling. 07:32.510 --> 07:34.100 We can do a lot more thing. 07:34.320 --> 07:38.900 I hope by now you understand the basics of reading writing appending. 07:39.060 --> 07:41.740 And also there are two other modes. 07:41.790 --> 07:45.210 The first one is w plus and the second one is atlast. 07:45.300 --> 07:51.030 The only difference with them is this sort of army can use are less than the same Come on. 07:51.020 --> 07:52.040 We can also read. 07:52.080 --> 07:53.100 We can try. 07:53.220 --> 08:01.290 I can't even I can just read that new class means I can read I can write big W. I can just try but there 08:01.290 --> 08:03.190 is danger of it does. 08:03.240 --> 08:04.840 So you can play with them. 08:04.890 --> 08:06.990 I hope you understand about file handling. 08:07.050 --> 08:07.670 Thank you for. 08:07.710 --> 08:13.580 All in all the letters till now and I am showing love going with Preedy wind speed and also you are 08:13.600 --> 08:14.670 learning a lot. 08:14.910 --> 08:16.250 So see you in the next one. 08:16.290 --> 08:18.640 We'll be talking a lot more interesting thing.