[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to get the linage of file?

Posted on 2000-03-23
2
Medium Priority
?
137 Views
Last Modified: 2010-04-04
I want to get the linage of a Text file.
Besides Use ReadLn to sum the linage, Has a simply way or function to get it.

thanks
kelvin
0
Comment
Question by:kelvinyu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
vinnair earned 150 total points
ID: 2652183
I assume linage means the number of lines.

You can use the Tstringlist class to good effect.
Do the following:

function getnolines(filename: string): integer;
var
  Mylist: TStringList;
begin
  MyList := TStringList.Create;
  MyList.LoadFromFile(filename);
  Result := MyList.Count;
  MyList.Free;
end;

This piece of code is enough. This is one of the simplest way to work with text files.
0
 

Author Comment

by:kelvinyu
ID: 2659399
it's better than count the linage one by one

Thanks
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question