x86 Assembly

Moderators: None (Apply to moderate this forum)
Number of threads: 4563
Number of posts: 16029

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Re: How can I cuont The number of words in a file ? Posted by m34tb34t on 10 May 2011 at 12:25 AM
The best solution will depend on the type of file you are counting words from and how you want to define a word. ASCII vs. Unicode. MS-Word docs vs. PDF files. It can get quite elaborate.

ASCII is the easiest to count groups of english letters with.

I would inc my counter on the first encounter of A-Z or a-z and skip everything else until I found a space, then skip any space characters until I encountered another alphabet character. Inc my counter again, rinse and repeat 'till you reach the end of the file.
Thread Tree



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.