----- Original Message ----- From: "N Khemker" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, December 13, 2004 8:50 PM Subject: (PT) How to find out the number of words in text file > Hello Guys, > Can anyone tell me HOW TO FIND OUT THE NUMBER OF WORDS IN SIMPLE TEXT FILE USING C COMMAND LINE PROGRAMME. > We have to consider all aspects and check all coditions for words in text file. > > Regards, > Neel. > ************************************************** All the words are separated with a blank space. A simply way to do this (not to efficiently, though) may be to parse all the text file and determine how many non-consecutive blank space you found. That is, determine if the next character is a blank space. If so, then the next character must be either a blank space, another character or the end of file. If it is a blank space, you skip to the next character. If it is the end of file, you return your count, and if it is another character, you add one to your count. Use isspace, isdigit, isalpha et al. to determine whether the character you're reading is a blank space, a number, a character, etc. Regards, Fernando. ------------------------ Yahoo! Groups Sponsor --------------------~--> $4.98 domain names from Yahoo!. Register anything. http://us.click.yahoo.com/Q7_YsB/neXJAA/yQLSAA/EbFolB/TM --------------------------------------------------------------------~-> To unsubscribe : [EMAIL PROTECTED] Yahoo! Groups Links <*> To reply to this message, go to: http://groups.yahoo.com/group/Programmers-Town/post?act=reply&messageNum=4520 Please do not reply to this message via email. More information here: http://help.yahoo.com/help/us/groups/messages/messages-23.html <*> To visit your group on the web, go to: http://groups.yahoo.com/group/Programmers-Town/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: (PT) How to find out the number of words in text file
Fernando Arturo G�mez Flores Fri, 17 Dec 2004 21:19:03 -0800
- Re: (PT) How to find out the number of words ... Fernando Arturo G�mez Flores
- Re: (PT) How to find out the number of w... pnadgir nadgir
- Re: (PT) How to find out the number of w... Michael White
