473,498 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

writing Program that print the number of newlines,words and characters in counted fil

1 New Member
What i'm trying to do is writing Program that print the number of newlines,words and characters in counted file by python

I'm lost and i do not how should i do it?

that what i got so far

Expand|Select|Wrap|Line Numbers
  1. infilename = input("Enter the name of the file:")
  2.  
  3. infile = open ( infilename ,'r')
  4.  
  5. for line in infile:
  6.     line = line.split()
Sep 26 '13 #1
1 1593
ryno du preez
91 New Member
Hi are you looking for something specific in the file or just how many caretakers is in the file?
Oct 2 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2053
by: janet | last post by:
how can i count how many words have i written in a text area??? Like taking an example ... i am writing in this textarea of microsoft usergroup. and say in total i have written 50 words .. how...
8
22442
by: Michael A. Covington | last post by:
Is there a way to make a C# program print the date on which it was compiled? Finding the file date of the executable is one way, but it's not foolproof. Thanks!
6
3251
by: Gary Wessle | last post by:
hi I have a data file with equal number of columns for each row. I need to get the number of rows and columns to allocate a matrix in gsl. getline (in, line) and parse the line for the number of...
3
6336
by: Nhd | last post by:
I have a question which involves reading from cin and counting the number of words read until the end of file(eof). The question is as follows: Words are delimited by white spaces (blanks,...
12
55897
by: kishore314 | last post by:
Hi, Just a small excerise for me. A program that counts number of words in a string. The program which i have written now is - import java.io.*; class countword { private static...
7
11307
by: Sharkie | last post by:
I need a regular expression which will evaluate to false if number of consecutive characters (non-whitespace) exceeds certain number (10 in this example). For example, I have this function: ...
2
3397
by: alwaali | last post by:
Hi I need help please This is my project and i need a help to solve it with you A page of text is to be read and analyzed to determine number of occurrences and locations of different words. The...
3
2853
by: vvsrinivasnalamati | last post by:
hi,i need a program that which prints the given number in words. ie if we enter 0123 the output will be as "ZERO ONE TWO THREE"
4
19783
by: JanineXD | last post by:
Hello, I already have the program ( convert number to words but only 0-999 ). I need it to be ( 0-9999 ). can you help me? package num2word; import java.util.Scanner;
0
7124
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6884
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7375
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5460
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4586
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1416
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.