Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page Count for a text file

Status
Not open for further replies.

Stoomis

Programmer
Jul 8, 2003
31
0
0
US
I am looping through a directory and processing each file that is present, and writing a companion file about each. In the companinon file I need to include the page count of the text file that is being processed. Is there are file property that will give the page count? Thanks
 
For a text file, there is no way for the file to know what it's page count is. It would be dependent on the settings of the program that you used to open the file. What does that program use for a default font? What size is the default font? What size are the default borders? None of his is stored in the text file so there is no way to get it from the text file itself. You could open each file with word, then you should be able to get a page count but it would be pretty slow.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top