473,385 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

file conversion?

Hello All,
how can we convert plan text file to binary file.

Thanks & Regards
Lokiii
Oct 22 '07 #1
4 1428
Hello All,
how can we convert plan text file to binary file.

Thanks & Regards
Lokiii

hello,
please do some helpful.

Regards
Lokiii
Oct 23 '07 #2
eWish
971 Expert 512MB
What have your tried? Have you read up on pack, unpack and binmode?
Oct 23 '07 #3
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
Oct 24 '07 #4
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

Hello
i am not getting any response from perl expert. i think no solution of this problem.

Regards
Lokiii
Oct 25 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Adam Balgach | last post by:
Greetings all, i am trying to parse up a CSV Comma delmited file from microsoft (gasp) excel. And then use that data to convert it to another file format (.arff). in any event, i am having a...
4
by: kalio80 | last post by:
Hi everyone I posted an enquiry earlier about using c++ code to convert text files between linux & widows. I ended up with this code: #include <iostream> #include <fstream> using namespace...
2
by: PhilBTL | last post by:
The shipping software we currently use stores our customer address in an Access database file. I need to import these records into a new shipping system that does not read Access files. Does anyone...
1
by: Burl Stafford | last post by:
I have a database that was created with Access 95. Is there a way to convert this to Access 2003? I keep getting errors: "broken reference to the file msjetsql.tlb version 3.0. Thank you,...
2
by: Missyfang | last post by:
Hi, I'm developing an PDA application of which part of it requires file conversion from .doc to either .psw or .txt though a web service. For a normal Windows application, I understand that this...
2
by: tenbach | last post by:
I have created a large data base of .wav files. The drive directory file displays the sequence of folders Music/Catagory/Artist/AlbumTitle/Song Titles. Is there any way to convert the 'directory...
0
by: Tom McL. | last post by:
I need to be able to convert a TIF file to an ICON file. Any ideas? Thanks
1
by: Neo007 | last post by:
**File Conversion from CSV format to Excel(.xsl) C# Detailed Requirement is : Requirements for File Conversion Application: 1.My Application must be command-line it should indicate success...
0
by: =?Utf-8?B?TWFyY2VlcG9v?= | last post by:
I'm a newbie using Visual Studio and Vb.Net. The vbscript below opens a Windows Explorer Search Window. The Windows Explorer Search Window has fields in which the user can insert: (i) a search...
1
by: =?Utf-8?B?a2F3aXNo?= | last post by:
hi i have some problam in msoffice documents, problam is.... i m open ms word or ms excel file but it asking file conversion n i dont see my save document... my documents save in english language...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.