Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

A REPORT ON

{FILE SEPERATOR}
SUBMITTED TO ZEAL COLLEGE OF ENGINEERING & RESEARCH
NARHE, PUNE – 411041
IN THE PARTIAL FULFILLMENT OF THE REQUIREMENTS
Project Based Learning
OF

SECOND YEAR ENGINEERING


(COMPUTER ENGINEERING)
SUBMITTED BY

{ MAYUR SAWANT} { SE C (S223056)}


{ MUBIN SHAIKH } { SE C (S223057)}
{ SHIVAM SHASHTE} { SE C (S223055)}
{ SHUBHAM MALI} {SE C (S223040)}

DEPARTMENT OF COMPUTER ENGINEERING

ZEAL COLLEGE OF ENGINEERING & RESEARCH


NARHE, PUNE – 411041
ZEAL COLLEGE OF ENGINEERING & RESEARCH
NARHE, PUNE – 411041

DEPARTMENT OF COMPUTER ENGINEERING


2020-2021

CERTIFICATE
This is to certify that the Project Based Learning Mini project report entitles

{ Project Title }

Submitted by
{ MAYUR SAWANT} { SE C (S223056)}
{ MUBIN SHAIKH } { SE C (S223057)}
{ SHIVAM SHASHTE} { SE C (S223055)}
{ SHUBHAM MALI} {SE C (S223040)}

are bonafide students of this institute and the work has been carried out by them under the
supervision of { PROF. KAILASH TAMBE } and it is approved for the partial
fulfillment of the requirement of Savitribai Phule Pune University, for the award of the Second
Year Engineering (Computer Engineering).

(prof. K. P. TAMBE) (Prof. A. V. Mote)


Guide Head
Computer Engineering Dept. Computer Engineering Dept.

Place: Pune Date:

Content for Report :


1) Introduction
2) Objectives & Motivation
3) Methodology / Implementation
4) Result
5) Conclusion
FILE SEPARATOR.
1. MAYUR SAWANT(S223056)

2. MUBIN SHAIKH(S223057)

3. SHIVAM SHASHTE(S223055)

4. SHUBHAM MALI(S223040)
Source code of the project

• Abstract— This project is basically about the GUI


graphical user interface. A file separator is a III. RESULTS AND DISCUSSION
character that is used to separate directory names that
makeup a path to a particular locations. Before : Before the files present in the address mentioned
by the user is unorganized . Files present in the location
contain files with all extension as shown in Fig [2] . This
often causes trouble while organizing it individually .
Keywords—os module, shutil module , file handling

I. INTRO
DUCTION A file separator is a
character that is used to separate
directory names that makeup a path
to a particular locations.This
character is operating system
specific.On Microsoft windows, it is
back slash character ().
Fig [2] before
Ex. C:myprojectmyfilesome.properties.
After : The files get organized and files with same
II. IMPLE extension is moved to new folder with respective extension
MENTATION DETAILS name .New folders are created with name extension-file at
The basic program deals with collecting the files the address mentioned by user as shown in figure Fig [3.1] .
with alike extension and moving them into a new Example folder with name ‘image files’ contain all files with
folder. extension ‘.jpg’,’.jpeg’, etc . as shown in figure .
Important necessary modules to be used in the program
mainly OS and SHUTIL.
Create a dictionary of the different extensions which
we want to separate. It will include the extension.
Ex : ‘audio-extension’={‘mp3’,’m4a’} Create a
function which collect all the files with same
extension in a list.
Cut all the files and move it into appropriate folder
using shutil.move() function.

Fig [1]
REFERENCES
List all the books, research papers, websites, etc. that you
referred while writing this report in the following format:

1] https://docs.python.org/3/library/os.html
2] https://docs.python.org/3.3/library/shutil.html.

Fig [3.1] after

Fig [3.2] all video files are in one


folder.

IV. CONCLUSION
File separator can be used for personal as well as industrial
use . it can easily separate different files with different
extension. It creates new folder at same location entered by the
user and paste files with same extension in new folders.
V . FUTURE SCOPE
The code can be modified to get the files inside an another
file to make it more convenient to use. Code can even be used
to create an app to make it user friendly.It can be used in various
companies which works in various data of different types for
file handling .
MODULE DESCRIPTION :
A).OS module: Provides a portable way of using operating
system dependent functionality.
Functions :
1. os.listdir() – To get the directory.
2. os.path.join() – To join
one or more component.
3. os.mkdir() – To create dictionary named path with
numeric module.
B )Shutil module: For creating temporary files and directories
see the tempfile module and for high level file and directory
handling.
Functions :
1.shutil.move() – To move all files of same
extension to a folder.
CODE OF PROJECT:
import os, shutil

dict_extensions = {
'audio_extensions' : ('.mp3', '.m4a', '.wav', '.flac'),
'video_extensions' : ('.mp4', '.mkv', '.MKV', '.flv', '.mpeg'),
'document_extensions' : ('.doc', '.pdf', '.txt','.pptx','.docx'),
'image_extensions' : ('.JPG', '.jpeg', '.png','.jpg'),
}

folderpath = input('enter folder path : ')

def file_finder(folder_path, file_extensions):


files = []
for file in os.listdir(folder_path):
for extension in file_extensions:
if file.endswith(extension):
files.append(file)
return files

for extension_type, extension_tuple in dict_extensions.items():


folder_name = extension_type.split('_')[0] + 'Files'
folder_path = os.path.join(folderpath, folder_name)
os.mkdir(folder_path)
for item in file_finder(folderpath, extension_tuple):
item_path = os.path.join(folderpath,item)
item_new_path = os.path.join(folder_path,item)
shutil.move(item_path,item_new_path)

You might also like