Add to Favorites    Make Home Page 1433 Online  
 Language Categories  
 Our Services  

Home » C++ Home » File Manipulation Home » spliter

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title spliter
Author saurabh
Author Email sid_isin [at] yahoo.com
Description This Program Will Split And Join Any File
Category C++ » File Manipulation
Hits 391408
Code Select and Copy the Code
/* Written By : Saurabh Jain II Year B.sc (Hons) Computer Science College Of Vocational Studies Delhi University This Program Will Split Or Join Any File Its A Complete Bug Free Program If Modified Please Send To : [email protected] */ #include<stdio.h> #include<iostream.h> #include<process.h> #include<conio.h> #include<io.h> #include <fcntl.h> struct s { unsigned long char c; } data; int main() { char name[40],filename[40],ans; long double size=0,i=0,j,parts,loop,mod=0,mod1=0,option,counter=0; unsigned int handel,st=0; long int status=0,whrex,whrey; FILE *fp,*fp1; cout<<" Welcome To The File Spliter Programe "; cout<<"1. Split A File 2. Join A File Enter Your Option "; cin>>option; if(option==1) { cout<<" Enter The Path Of The File Which Is To Be Splited "; gets(name); fp=fopen(name,"rb"); if(fp==NULL) { cout<<" Cannot Open The Source File ------> Press Any Key To Exit....... "; getch(); exit(1); } cout<<" Please Wait ---------------> WHILE FILE BEING ANALYSED ......... "; while(fread(&data,sizeof(data),1,fp)>0) { size++; } handel=open(name,O_CREAT); cout<<" The Size Of The File Is "<<filelength(handel)<<" BYTES "; mod=size-1; rewind(fp); status=size/100; cout<<" Enter The Parts In Which File Is To Be Splited "; cin>>parts; loop=size/parts; for(i=1;i<=parts;i++) { cout<<" Enter The "<<i<<" Target File Name "; gets(filename); fp1=fopen(filename,"wb"); if(fp1==NULL) { cout<<" Cannot Open Target File Name ------> Press Any Key To Exit....... "; getch(); exit(1); } cout<<" Please Wait ...................... "; whrex=wherex(); whrey=wherey(); for(j=1;j<=loop;j++) { fread(&data,sizeof(data),1,fp); mod1++; counter++; if(counter==status) { st++; gotoxy(50,15);cout<<"completion status.... "<<st<<" % "; counter=0; } if(mod1!=mod) { fwrite(&data,sizeof(data),1,fp1); } } gotoxy(whrex,whrey+1); fclose(fp1); } fclose(fp); cout<<" File Spliting Completed Press Any Key To Exit"; getch(); } if(option==2) { cout<<" Enter The Name Of The Target File "; gets(name); fp=fopen(name,"wba"); if(fp==NULL) { cout<<" Cannot Open Target File ------> Press Any Key To Exit....... "; getch(); exit(1); } do { i++; cout<<" Enter The Name Of The "<<i<< " File "; gets(filename); fp1=fopen(filename,"rb"); if(fp1==NULL) { cout<<" Cannot Open Source File ------> Press Any Key To Exit....... "; getch(); exit(1); } cout<<" Please Wait ...................... "; while(fread(&data,sizeof(data),1,fp1)>0) { fwrite(&data,sizeof(data),1,fp); } fclose(fp1); cout<<" Do You Want To Join Another File (y/n) "; cin>>ans; }while(ans=='y'); fclose(fp); handel=open(name,O_CREAT); cout<<" The Size Of The File Is "<<filelength(handel)<<" BYTES "; cout<<" Joining Of Files Completed Press Any Key To Exit "; getch(); exit(1); } return 0; }

Related Source Codes

Script Name Author
Moving ball screen saver karlmarx
The Classic Game of Snake & Ladder Lakshmi Narayana .A
Railway seat reservation question which comes in sapient VyomWorld
To calculate percentile Ravi Mathur
Send to folder ANIMESH SAHU
Analog clock and calendar Nazia & Rida
HIGH/LOW GAME MOLLY ARORA
Data structure (stack Implimentation) Swapnil B Adsure
Memory Game AnirudhSanyal
Easy Calc Anirudh Sanyal
GK Quiz Anirudh Sanyal
Hangman Game Manish Jain
Snakeman Manish Jain
Full month Calendar Nigi
Cursor shapes nigi

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions | Important Websites
Copyright ©2003-2024 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptID=1117


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review