473,397 Members | 2,028 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,397 software developers and data experts.

How to Count the Number of Rows in Text and ODBC Files (Btrieve)

Hi.

I need the count of the number of rows within a text file.
I checked the File object but could not find a method there to do what I need.

Is there an efficient way to count the numbers of rows?
Currently all I can think of is opening the file for reading and counting
every row.
This could be a long tedious task as some of the text files have millions of
rows in them.

I also need to count the number of rows in Btrieve files. I use an ODBC for
writing to these files.

Any suggestions will be greatly appreciated.

Rita
Oct 5 '05 #1
2 2035
Rita,

The cariage return is just a byte in a text file.

Therefore I see no better solution than just reading it line by line and
counting.

(Any other solution will mean that you have to read the complete file as
well so that won't help you).
Cor
Oct 6 '05 #2
Thanks for your response.
It's a bit disappointing - not what I wanted to hear! :-)

"Cor Ligthert [MVP]" wrote:
Rita,

The cariage return is just a byte in a text file.

Therefore I see no better solution than just reading it line by line and
counting.

(Any other solution will mean that you have to read the complete file as
well so that won't help you).
Cor

Oct 6 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Hari Om | last post by:
Here are the details of my error log files: I execute the command and get following message at console: ---------------------------------------------------------------------- ../sqlldr...
2
by: edunetgen | last post by:
I have big applications with Btrieve Btrieve/N and Btrieve Novell. I am developing the same ones in .net (AspNet, C# and Sql) and I need to access to files btrieve. (that are in production). ...
0
by: JSwinney | last post by:
Greetings! I know this kind of question gets asked here almost daily, but as a newbie I have sort of a twist: I'm needing to take some reports I've written in Access that link to Btrieve files...
1
by: matt (ziba) | last post by:
using the Microsoft.Data.Odbc component instead of System.Data.Odbc how do u get a row count using the Microsoft.Data.Odbc.OdbcDataReader ?? and is it best to use Microsoft.Data.Odbc OR...
2
by: RitaG | last post by:
Hi. I need the count of the number of rows within a text file. I checked the File object but could not find a method there to do what I need. Is there an efficient way to count the numbers of...
5
by: dananrg | last post by:
I was messing around with the native ODBC module (I am using Python in a Win32 environment), e.g: import dbi, odbc ....and it seems to meet my needs. I'd rather use a module that comes...
68
by: Martin Joergensen | last post by:
Hi, I have some files which has the following content: 0 0 0 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 0 0 0 0 0
4
by: Peter W Johnson | last post by:
Hi guys, I have a problem with a datagrid record count. Here is the code:- <snip> Public Class frmMerchantDeposit Inherits System.Windows.Forms.Form Dim myconnection As New...
0
by: tania | last post by:
i have this table in my database: CREATE TABLE FILM( F_ID INT(5) NOT NULL AUTO_INCREMENT, F_TITLE VARCHAR(40) NOT NULL, DIRECTOR_FNAME VARCHAR(20) NOT NULL, DIRECTOR_LNAME VARCHAR(20) NOT NULL,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.