473,387 Members | 1,890 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,387 software developers and data experts.

To find the number of rows and columns of a binary file

hello people....

can anyone help me with finding the number of rows and columns of a binary file....any code related would be appreciated....


Thanks
Ranjit
Nov 21 '06 #1
6 2345
sivadhas2006
142 100+
Hi Ranjit,

Can I know why you need to get the number of rows and columns in the binary file?

Regards,
M.Sivadhas.
Nov 21 '06 #2
hiii...

Ofcourse.....i will be searching for a 0xff 00 00 in the binary file and i can read the file into the array and check it but i want to know the coordinates of where this condition occurs...so i want to know the no of rows and columns.....
is there a diff approach to find the cordinates...???

Thanks
Ranjit
Nov 21 '06 #3
Banfa
9,065 Expert Mod 8TB
There is no such thing as rows and columns in a binary file.

A text file has rows (lines) identifiable by the end of line character.

If required columns can be defined by using another character as a column separator.

Generally binary files are just not layed out like this.
Nov 21 '06 #4
macklin01
145 100+
Do you mean a specific format of binary file? (e.g., a bitmap image, or a word document, or something like that?) -- Paul
Nov 22 '06 #5
hi....

ya...for a bitmap of a bmp image.....

Thanks
Ranjit
Nov 22 '06 #6
macklin01
145 100+
hi....

ya...for a bitmap of a bmp image.....

Thanks
Ranjit
Sorry for my delayed response. My subscriptions weren't working for me.

Of course I'm biased, but I'd say go with an open source solution:

Expand|Select|Wrap|Line Numbers
  1. #include "EasyBMP.h"
  2.  
  3. // ... 
  4.  
  5. BMP Image;
  6. Image.ReadFromFile( "some_image.bmp" );
  7.  
  8. cout << "The image is " 
  9.      << Image.TellWidth()  << " pixels wide by " 
  10.      << Image.TellHeight() << " pixels tall." << endl << endl;
  11.  
Done! ;) -- Paul
Dec 14 '06 #7

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

Similar topics

2
by: Neil Zanella | last post by:
Hello, I would like to know whether having a <table> element with two <tr> elements each containing one <td> elements and two <td> elements, respectively, is legal from the point of view of...
17
by: Justin Emlay | last post by:
I'm hopping someone can help me out on a payroll project I need to implement. To start we are dealing with payroll periods. So we are dealing with an exact 10 days (Monday - Friday, 2 weeks). ...
1
by: Lars E | last post by:
Hi all I have a small problem. I have a datatable with 8 columns. But it is only data in 5 of the columns. Data for the remaing 3 columns is in another dataset. I Want to run trough the...
6
by: Gary Wessle | last post by:
hi I have a data file with equal number of columns for each row. I need to get the number of rows and columns to allocate a matrix in gsl. getline (in, line) and parse the line for the number of...
6
by: kilter | last post by:
Anyone know of a routine that will return the number of rows and columns in a matrix?
0
by: sysmanint1 | last post by:
I am a total neophyte at Visual Basic but found the following post and reply from Clint concerning a dynamic range. Also, have never "posted" to a discussion I have made a macro that works on...
3
by: jasvinder singh | last post by:
Respected Sir/madam, Can you help in providing code in 'C' for Reading text file with n number of rows and columns and putting the result in arrays.The sample file is as follows: rim_label =...
9
by: xiao | last post by:
It always dumped when I tried to run it... But it compiles OK. What I want to do is to do a test: Read information from a .dat file and then write it to another file. The original DAT file is...
19
by: fera | last post by:
Hi to all of you guys here… A friend of mine gave me: 1). A paper with a table of 350 rows x 284 columns, which each cell contains of a single number from 0 to 9. This table didn’t typed yet into...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.