Logo 
Search:

Unix / Linux / Ubuntu Articles

Submit Article
Home » Articles » Unix / Linux / Ubuntu » Homework HelpRSS Feeds

Program to perform operations like Count char,words and lines of file, display file in reverse, change case and frequency of a particular word in file

Posted By: Adelino Fischer     Category: Unix / Linux / Ubuntu     Views: 6092

Program to perform operations like Count char,words and lines of file, display file in reverse, change case and frequency of a particular word in file.

Code for Program to perform operations like Count char,words and lines of file, display file in reverse, change case and frequency of a particular word in file in Unix / Linux / Ubuntu

clear
t=0
# temp=0
echo "Enter the file name"
read f1

if [ -f $f1 ] 
then 

echo "1.Count char,words and lines"
echo "2.File in Reverse"
echo "3.Frequency of a particular word in file"
echo "4.Change of Case"
echo "5.Exit"

echo "Enter your choice ?"
read ch

case $ch in
    1) wc -c $f1 
       echo " characters"
       wc -w $f1 
       echo " words"
       wc -l $f1 
       echo " lines";;

     3)  echo "Enter the word whose occurences has to be found out "
         read c
         t=`echo $f1|wc -c`
         echo $t;;
         

        
    5)exit;;


esac
else 
echo "File does not exists !!!!"
fi
  
Share: 



Adelino Fischer
Adelino Fischer author of Program to perform operations like Count char,words and lines of file, display file in reverse, change case and frequency of a particular word in file is from Frankfurt, Germany.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!