CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 1999
    Posts
    370

    How to know how many characters there are in a text file

    Hi, Is it possible to konw that ?

    Thanks
    Olivier


  2. #2
    Join Date
    May 1999
    Location
    Jerusalem, Israel
    Posts
    251

    Re: How to know how many characters there are in a text file

    If you want to know, how many printable characters (letters, number etc.) in the file, you'll need to count them.
    If you want to know quantity of all characters (including spaces, new lines etc.) in the file, simple get file size in bytes if the file is ASCII file and half of file size if the file uses wild characters.
    Finally, if you want to know roughly how many printable characters in the file, you can count an average percentage of printable characters in some common text files and calculate the roughly value using that percentage and file size.

    Jack.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured