When I look at the English word corresponding to the phone number of "beautiful programming", I think that sometimes I receive digital text messages such as "43" when I think of college ", in fact, Translation into Chinese characters means "Haha", but you have to rely on your brain for analysis, so I spent some time writing a small program, after converting "43" to "he", the code from "he" to "ha" has not b
The number of words in the text box (How many words are left in the input) I used this function when I made a small website today. I pasted the Code as follows:
Code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> ASPX page code:
Code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Word
Reference from: ht
This article describes the way php reads a text file and prints out the most characters and the number of times the row is used. Share to everyone for your reference, specific as follows:
Test.txt file:
Welcome to our website jb51.net
www.jb51.net
php asp java JSP
PHP code (read Test.txt file):
$myfile = fopen ("Test.txt", "R");
while (!feof ($myfile)) {
$line _str = fgets ($myfile);
$
#!/usr/bin/env python#filename:readfile.pycodelist=[]f=file (' Input.txt ', ' r ') lines = F.readlines (); For I in range (len (lines)): line=lines[i].strip (' \ n '); Print line codelist+=lineprint codelist########################################## #map ={}for i in Codelist: If Map.has_key (i) ==false: map.setdefault (i,1) else: count=map.get (i) +1 map[i]=countprint map#### ######################################## Sort Map #
I once wrote a C program on Linux, using Lex to do lexical analysis to simultaneously count the number of characters, words, and lines in n-text files. Makes me think Lex is really interesting. It's true that Lex is very powerful, and it's good to do small lexical analysis. This procedure refers to an example in Lex and YACC.
%{unsigned int char_count = 0, Word_count = 0, Line_Count = 0;
%%}% [^/t/n]
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.