If we tried to open a 2.3 Gigabyte text file, error message will apear telling you "Notpad can't open the file because it is very huge, try to use a different text editor".
Thus, we will do a program to divid the huge file into 30 parts nearly each of size 76 megabyte nearly and each has 10,000,000 words nearly.
so 10,000,000*30=300,000,000 words. 76*30=2280 megabyte=2.3gigabyte nearly.
-------------------------------------------------------------------------------
// program to divid the whole 2.3 gigabyte file to 36 parts
//0
#include <iostream>
#include <fstream>
#include <string>
//1
using namespace std;
//2
int main ()
{
// reading IN file
ifstream IN;
IN.open("IN.txt");
// defintions
char no[] = {'a', 'b', 'c', 'd', 'e'};
char no1[] = { '1', '2', '3', '4', '5', '6'};
string name1 = "Part";
string name;
while (! IN.eof() )
{
// names of the output files
for (int i=0; i < 5; i++)
for (int j=0; j< 6; j++)
{
name = name1 + ' ' + no[i] + '_' + no1[j] + ".txt";
string s;
IN >> s;
// ofstream OUT;
ofstream OUT;
OUT.open(name.c_str());
for ( int l=1; l<=10000000; l++)
{OUT << s << endl;
IN >> s;}
}
}
system("pause");
return 0;
}
Archive
-
▼
09
(149)
-
▼
May
(34)
- bubble sorting algorithm
- (سورة البقرة) بصوت الشيخ عبد الباسط عبد الصمد
- www.flickr.com
- First Picture
- To Divid The Huge File.cpp
- The Previous Program
- Program To Get The List Of All Possible Combinatio...
- بإذن الله ساحاول انشر اكواد برامج لعمل مكتبة
- HelpAssistant GU*7Vi73TuKfQM
- this book has no doubts.
- 15,783,314$ USAID->LEAD & Diversity
- Basher El Sabreen
- El7alazona Yama el7alazona
- Betfakar fe eih
- Esloob meen dah ya Morpheus
- Fe el hawa sawa
- Al Ensan (Do you know him well)
- Darkness, the black color, or the lack of light an...
- Bettegry raye7 feen
- The sea is the mirror of the sky!
- The see is like the sky (is it it's reflection?)
- Elward Gameel
- Montain speaks to the sea and to the sky
- Lonely tree with the sun
- 3ellah mn alshgar ( trees family )
- How clouds float? Sob7an Allah
- Beethoven the Baby!
- Baby Beethoven
- Beyakol
- Gameel khales
- Gameel
- Katkota
- Allah 3la Ayam Zaman
- Besm Ellah Nabda'
-
▼
May
(34)