programs text file, binary files
programs text file, binary files
txt”
asking the user to write a single line of text by user input.
Define a function program4 to count the total number of upper
case, lower case, and digits used in the text file “merge.txt”.
Define a function as program5 to count a total number of lines and
count the total number of lines starting with ‘A’, ‘B’, and ‘C’.
(Consider the merge.txt file)
Define a function program6 to find the total occurrences of a
specific word from a text file
Write a program to know the cursor position and print the
text according to below-given specifications:
1.Print the initial position
2.Move the cursor to 4th position
3.Display next 5 characters
4.Move the cursor to the next 10 characters
5.Print the current cursor position
6.Print next 10 characters from the current cursor position
Write a program in python to replace all word “the”
by another word “them” in a file “poem.txt”
Find the output of the following:
Find the output of the following:
Write a program in python to replace a character
by another character in a file “story.txt”. (Accept
the characters from the user)
Write a python code to read a file “data.txt”
and display only those lines whose length is
more than 4 characters.
Write a program in python to remove all
duplicate lines from the file “story.txt”
Write a program in python to display only
unique words from the file “story.txt”
Write a program in python to count those
words whose length is more than 7 characters
in a file “story.txt”
Write a program to copy the alternate lines
from “data.txt” to “story.txt”
Write a program to read the entire content
from file “data.txt” and copy only those words
to “story.txt” which starts with vowel
A binary file “Book.dat” has structure [BookNo,
BookName,Author, Price]
1. Bus number
2. Bus starting point
3. Bus destination