Chapter 05 - File Handling
Chapter 05 - File Handling Type C: Programming Practice/ Knowledge based Questions 1. Write a program that reads a text file and creates another file that is identical except that every sequence of consecutive blank spaces is replaced by a single space. 2. A file sports.dat contains information in following format: Event ~ Participant. Write a function that would read contents from file sports.dat and create a file named Atheletic.dat copying only those records from sports.dat where the event name is "Athletics". 3. A file contains a list of telephone numbers in the following form: Arvind 7258031 Sachin 7259197 The names contain only one word the names and telephone numbers are separated by white spaces. Write a program to read a file and display its contents in two columns. 4. Write a program to count the words 'to' and 'the' present in a text file "Poem.txt". 5.Write a program to count the number of upper-case alphabets ...