What have your tried? Have you read up on pack, unpack and binmode?
Hello eWish,
i've tried so much.but not coming exact solution.
step 1: i am reading text file by using open(IN, "$in_file_name");
step 2: i m creating binary file. open(OUT, ">$out_file_name");
step 3: binmode(IN); binmode(OUT);
step 4: while($data=<IN>)
print OUT $data;
step 5;close(IN); close(OUT)
but after this not making binary file. whatever data i am reading from text. that data coming same format.
but diffrence of TEXT and BINARY file is:
A binary file is a computer file which may contain any type of data, encoded in binary form for computer storage and processing purposes; for example, computer document files containing formatted text. Many binary file formats contain parts that can be interpreted as text; binary files that contain only textual data - without, for example, any formatting information - are called plain text files. In many cases, plain text files are considered to be different from binary files because binary files are made up of more than just plain text.
If a binary file is opened in a text editor, each group of eight bits will typically be translated as a single character, and you will see a (probably unintelligible) display of textual characters. If the file were opened in some other application, that application will have its own use for each byte: maybe the application will treat each byte as a number and output a stream of numbers between 0 and 255 — or maybe interpret the numbers in the bytes as colors and display the corresponding picture. If the file is itself treated as an executable and run, then the computer will attempt to interpret the file as a series of instructions in its machine language.
Thanks & Regards
Lokii