1
00:00:00,060 --> 00:00:06,510
Previously, we worked with files, but in a superficial level, meaning we perform an operations such

2
00:00:06,510 --> 00:00:11,760
as changing file names and extensions, deleting and copying files, cetera.

3
00:00:12,060 --> 00:00:19,620
So actions which did not involve looking inside the files, we did not read or manipulate the contents

4
00:00:19,620 --> 00:00:20,520
of the files.

5
00:00:21,570 --> 00:00:23,700
So we're going to do that in this section.

6
00:00:24,120 --> 00:00:27,600
We're going to load the contents of the files, change the content.

7
00:00:27,960 --> 00:00:30,330
We're going to read the files.

8
00:00:30,780 --> 00:00:33,130
But let's be clear about one thing.

9
00:00:33,150 --> 00:00:36,300
First, there are two major file types.

10
00:00:36,660 --> 00:00:39,180
Binary and non-binary files.

11
00:00:39,480 --> 00:00:45,540
Non-binary files are text files, and we're going to work on non-binary files.

12
00:00:45,740 --> 00:00:47,730
So text files in this section.

13
00:00:47,880 --> 00:00:52,140
Text files are all files that can be viewed through a text editor.

14
00:00:52,290 --> 00:00:59,430
For example, the text files that HTML that see us v that puoi files as well.

15
00:00:59,850 --> 00:01:02,760
All these are examples of text files.

16
00:01:03,180 --> 00:01:10,380
You can just open these files with a text editor, such as notepads or by charm, et cetera, and you

17
00:01:10,380 --> 00:01:15,600
can see the contents of these files and the content is always text.

18
00:01:16,380 --> 00:01:18,960
And of course, you can also edit the content.

19
00:01:19,320 --> 00:01:21,270
So, for example, that's profiles.

20
00:01:21,300 --> 00:01:22,860
All we have is text.

21
00:01:23,250 --> 00:01:35,700
In contrast, binary files are files such as that jpg that zip that and before, and even that PDF and

22
00:01:36,060 --> 00:01:37,320
Doc X files.

23
00:01:37,620 --> 00:01:39,810
These are examples of binary files.

24
00:01:40,170 --> 00:01:45,930
Any file that has information other than text as a binary file?

25
00:01:46,680 --> 00:01:55,350
Yes, PDF and doc docs contain text, but they also contain other information, such as the phone style

26
00:01:55,350 --> 00:01:57,150
and the size of the text.

27
00:01:57,630 --> 00:02:04,260
Sometimes they contain pictures or other media files embedded in the documents in the file.

28
00:02:05,430 --> 00:02:11,940
On the other hand, text files contain text and only text, and you can load that text in Python as

29
00:02:11,940 --> 00:02:19,470
a shrink and then manipulate the string and perhaps write the contents back to the file so you are changing

30
00:02:19,470 --> 00:02:20,550
the contents of the file.

31
00:02:20,700 --> 00:02:27,240
Of course, it is also possible to manipulate binary files such as PDF or JPEG files.

32
00:02:27,480 --> 00:02:36,150
But for those files, we need specific Python libraries designed to manipulate a particular file type,

33
00:02:36,150 --> 00:02:38,120
such as the JPEG.

34
00:02:38,460 --> 00:02:43,740
And there are sections in the course that cover the processing of PDF files.

35
00:02:43,740 --> 00:02:45,630
So we have sections on PDF files.

36
00:02:45,840 --> 00:02:54,240
We have sections on image processing, processing, word documents, etc. But in this section, we focus

37
00:02:54,510 --> 00:02:57,420
exclusively on non-binary files.

38
00:02:57,570 --> 00:03:01,840
So text files, let us get started and I'll talk to you in the next video you.

