Is there any way to load a file with a suffix other than ".txt" like a text file? If not, how do you load files with other suffixes and in what format does data come out of them?
File Loading
Collapse
X
-
Tags: None
-
Sure, feel free to create a file text.o that contains just text of create file bin.txtOriginally posted by compman9902Is there any way to load a file with a suffix other than ".txt" like a text file? If not, how do you load files with other suffixes and in what format does data come out of them?
that contains just binary data. Extensions are just a human convention but the
files themselves can store anything you like and you can read them as you like.
Extensions don't tell you anything.
kind regards,
Jos -
To load a file other than a text file, you should open it in binary mode, just to be safe. You have to research the file format first (usually you can just google it), and then you have to write code that can read in the file and store the image/sound/music/whatever in the data structure you are using. Some formats are easier to load than others, and some of them are copyrighted. Files like images and sound usually don't look like much in text format. Here is an excerpt from my avatar:
Hope this makes sense.Ì3Ì3Ì3ÿ3fÿ fÌfÿ3ÿ™f™™™ÿ3™™ ÿ3ÿÌ3 !ÿNETSCAPE2.0 !ù , 2 2 ÿ «X™#€ 0 !€ 0 @ €‹+j0âÁB…zp aÑ"–'<vComment
-
Actually this makes a lot of sense. Thanks for replying to my post. As a matter of fact, I have opened many files in notepad, just to see what their guts look like. In one case, it crashed my computer! (Its was a 50 megabyte mpeg movie file, on a very old computer).Originally posted by boxfishTo load a file other than a text file, you should open it in binary mode, just to be safe. You have to research the file format first (usually you can just google it), and then you have to write code that can read in the file and store the image/sound/music/whatever in the data structure you are using. Some formats are easier to load than others, and some of them are copyrighted. Files like images and sound usually don't look like much in text format. Here is an excerpt from my avatar:
Hope this makes sense.Comment
Comment