0% found this document useful (0 votes)
9 views9 pages

CCP File Managment

The document is a seminar report on 'Problem Solving Using C' submitted by students of KLS Gogte Institute of Technology for the academic year 2021-22. It discusses file management, including file handling functions in C, and provides programming examples for creating and managing files. Additionally, it highlights the benefits of electronic file management systems, such as reducing costs, improving productivity, and eliminating misfiling.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views9 pages

CCP File Managment

The document is a seminar report on 'Problem Solving Using C' submitted by students of KLS Gogte Institute of Technology for the academic year 2021-22. It discusses file management, including file handling functions in C, and provides programming examples for creating and managing files. Additionally, it highlights the benefits of electronic file management systems, such as reducing costs, improving productivity, and eliminating misfiling.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

A

Seminar Report
on

“SEMINAR TOPIC”

Submitted By

Sl No. Name of the student Roll No. USN Signature

Subject: Problem Solving Using C Code:21CCP14

Department of Computer Science and Engineering

KLS Gogte Institute of Technology,

Udyambag, Belagavi - 590008, Karnataka, India

Academic year 2021-22


Course Activity Seminar report and ppt content
Marks allocation:
Batch No. :
1. Seminar Title: Marks Roll.No
Range

2 Abstract (PO2)
0-1
.
3 Application of the topic to the course (PO2)
0-2
.
4 Literature survey and its findings (PO2)
0-1
.
5 Methodology, Results and Conclusion
0-3
. (PO1,PO3,PO4)
6 Report and Oral presentation skill
0-2
. (PO9,PO10)
Total 10
1.Engineering Knowledge: Apply the knowledge of mathematics, science, engineering
fundamentals and an engineering specialization to the solution of complex engineering problems.
2.Problem Analysis: Identify, formulate, review research literature, and analyze complex
engineering problems reaching substantiated conclusions using first principles of mathematics,
natural sciences and Engineering sciences.
3.Design/Development of solutions: Design solutions for complex engineering problems and design
system components or processes that meet the specified needs with appropriate consideration for the
public health and safety, and the cultural, societal, and environmental considerations.
4.Conduct investigations of complex problems: Use research-based knowledge and research
methods including design of experiments, analysis and interpretation of data, and synthesis of the
information to provide valid conclusions.
5.Modern tool usage:Create, select, and apply appropriate techniques, resources, and modern
engineering and IT tools including prediction and modeling to complex engineering activities with
an understanding of the limitations.
6.The engineer and society:Apply reasoning informed by the contextual knowledge to assess
societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to the
professional engineering practice.
7.Environment and sustainability: Understand the impact of the professional engineering solutions
in societal and environmental contexts, and demonstrate the knowledge of, and need
for sustainable development.
8.Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms
of the engineering practice.
9.Individual and team work: Function effectively as an individual and as a member or leader in
diverse teams, and in multidisciplinary settings.
10.Communication: Communicate effectively on complex engineering activities with the
engineering community and with society at large, such as, being able to comprehend and write
effective reports and design documentation, make effective presentations, and give and receive clear
instructions.
11. Project management and finance: Demonstrate knowledge and understanding of the
engineering management principles and apply these to one's own work, as a member and leader in a
team, to manage projects and in multidisciplinary environments.
12. Life-long learning: Recognize the need for and have the preparation and ability to engage
in independent and lifelong learning in the broadest context of technological change.
FILE MANAGEMENT
WHAT IS FILE MANAGEMENT?
We have been using functions such as printf scanf to read and write data. These are console
oriented I/O functions. These are time consuming to handle large volumes of data through
terminals. The entire data is lost when the computer is turned off. Therefore it is necessary to
have more flexible approach where data can be stored in hard disks permanently without
destroying any data. This file employs the file to store data. A file is a place on a disk where
a group of related data if stored.
File handling:
To create the file , to close the file, to store the record the file. Like :fclose ( ) , fopen ( ) , getc
( ) , putc ( ) , fgets ( ) , fputs ( ) , fprintf ( ) , fscanf ( ).
These are the main functions other than these some more functions are there.
• fopen ( ) : creates a new file , opens an existing file.
• fclose ( ) : closes a file which has been opened for use.
• getc ( ) : reads a character from a file.
• putc ( ) : writes a character to a file.
• fprintf ( ) : writes a set of data values to a file.
• fscanf ( ) : reads a set of data values to a file.
Defining and opening a file
If we want to store data in secondary memory we must specify certain things about the file to
the operating system :
1-Data Structure 2- Filename 3-Mode
Data structure : operatng of a file to store the adress of first character we need to have pointer.
• FILE *fp;
• Fp = fopen (“fileame” , “mode”)
• where * is ponter and FILE is data structure of a file.
• Filename : Filename is a string of characters that make up a valid filename for the operating
system.
• Mode : it has 3 types of mode. Read , write and append mode.
• Reading mode : if the purpose is reading and if exists then the file is opened with the currrent
contents safe otherwise error occurs.
• Writing mode: when the mode is writing a file with all the specified name is created if the
file does not exists . The contents are deleted , if the file allready exists.
• Append mpde: when the purpose is appending the file is opened with the current contents
safe . A file with the specified name is created if the file does not exists.

Closing a file:
A file must be closed as soon as all operations on it have been completed. It prevents any
accidential misuse of the file . In this case there is a limit to the number of files that can be
kept open simultaneously. We have to close the file when we want to reopen the same file in
a different mode.
The fprintf and fscanf functions:
The functions fprintf and fscanf are I/O functions they off course work on the file.
The general form of fprintf is
fprintf (fp , “control string” , list) ;
Where fp is file pointer associated with the file that has been opened for working. the control
string contains output specifications for the items in the list. The list may include variables,
constanrs and strings.
Similarly fscanf (f2 , “%s %d “ , item , &quantity) ;
This statement would cause the reading of the items in the list from fp, according to the
specifications contained in the control string.
Programing Example 1 On File Management
C program to create a file named ‘Integers’ and input the integers from keyboard and display the
output in output file.
#include<stdio.h>
int main( )
{
FILE *fp ;
int num ;
fp = fopen (“Integers” , ”w”) ;
if (fp ! = num)
{
printf (“File created successfully!\n”) ;
}
else
{
printf (“Failed to create the file\n”) ;
exit (0) ;
}
printf (“Enter some integer numbers [Enter -1 to exit] : “) ;
while (1)
{
scanf (“%d” , &num) ;
if (num ! = -1)
{
putw (num , fp) ;
}
else
break ;
}
fclose (fp) ;
fp = fopen (“integers” , ”r”) ;
printf (“\nNumbers:\n”) ;
while ((num = getw (fp)) ! = EOF)
{
printf (“%d\n” , num) ;
}
printf (“\nEnd of file.\n”) ;
fclose (fp) ;
}
Implimentation :
First the file pointer is created, then num variable is declared then the file is created with the
name “Integer”. Then the condition is chucked ( fp ! = num ) if this is true then the file is
successfully created or else failed to create the file. Then we input some integer number until the
input is – 1 . as soon as the input is – 1 the inputting process stops, then the file is closed using the
function fclose ( ). Then the same file is opened in the read mode and the numbers are extracted and
put in to the output file and the output will be according to the input file. At the end the file is closed.
Output :
File created successfully!
Enter some integer numbers [Enter -1 to exit] :
98 15 34 75 7 -1
Numbers :
98
15
34
75
7
End of file .
Programing Example 2 On File Management :
A file named DATA contains a series of integers numbers .Code a program to read these numbers
and them write all ’ODD’ numbers to a file to be called ODD an all ‘EVEN’ numbers to a file to be
called EVEN.
#include<stdio.h>
main( )
{
FILE *f1 ,*f2 ,*f3 ;
int number , i ;
printf (“Contents of the DATA file\n\n”) ;
f1 = fopen (“DATA” , ”w”) ;
for ( i = 1 ; I < = 30 ; i++ )
{
scanf (“%d” , &number) ;
if (number == -1)
break ;
putw (number , f1) ;
}
fclose (f1) ;
f1 = fopen (“DATA” , ”r”) ;
f2 = fopen (“ODD” , ”w”) ;
f3 = fopen (“EVEN” , ”w”) ;
while((number = getw (f1)) ! = EOF)
{
if (number %2 == 0)
putw (number , f3) ;
else
putw (number , f2) ;
}
fclose (f1) ;
fclose (f2) ;
fclose (f3) ;
f2 = fopen (“ODD” , ”r”) ;
f3 = fopen (“EVEN” , ”r”) ;
printf (“Content of ODD file\n”) ;
while (number = getw (f3)) ! = EOF)
printf (“%d” , number) ;
fclose (f2) ;
fclose (f3) ;
}

Implementation :
First three file pointers are created f1 , f2 , f3. Now variables number and i are declared. Then
a file is created named DATA and random numbers are inputted and the file is closed using fclose ( )
function. Then the same file is opened in the read mode. And other two files are created named ODD
and EVEN. Now the numbers are extracted from DATA file and checked weather the number is odd
or even, like the number is divided by 2 and if the reminder is zero then the number is even or else it
is odd. If the number results to odd then the number is stored in the ODD file and if the number
results to even, then the number is stored in the EVEN file. At the end all the files are closed.
Output :

DATA : 5 16 2 25 46 37
ODD : 5 25 37
EVEN : 16 2 46
Conclusion :
● Eliminate loss of files
Managing large volumes of paper-based documents day in and day out can make one error-prone.
They are stored in databases on your computer or network become easy to search, especially if
you use document management software.
● Eliminate misfiling
You may take care to not lose a document, but as filing paper manually can make one error-prone,
it does increase the chances of misfiling a document. An electronic file management software
saves you that cost as files can be organized systematically in a range of ways. This means no
matter where you have stored the file in your file management system, all it takes to find it is a
quick search.
● Reduce recurring costs of office supplies
Creating and copying paper-based documents and taking printouts liberally for circulation,
amounts to huge paper consumption levels. Add to it the cost of cartridges, boxes, folders, pins,
and clips, etc. All these are items of recurring expenditure. Once you digitize your paper archive
and all incoming documents and create all new documents in digital formats, these recurring
expenses will drop dramatically. The added benefit is that you also eliminate the capital expenses
of buying new cabinets, printers, and copiers that perpetuate your dependence on paper.
● Release cash
Once you have fully adopted an electronic file management system, you can sell old, obsolete
printers and copiers that are no longer needed. That’s because the document management
software would have made these machines redundant. Selling them unblocks cash and releases it
back into your business.
● Improve employee productivity and customer service
An electronic file management software system helps organize documents in various ways. So
your employees can find files fast and save time. They can accomplish more work in the given
amount of time. Sow service portrays an image an unprofessional workforce. But quick response
using automated processes reflects positively on the image of your organization.

You might also like