Tuesday, 16 March 2010
All the glory when you ran outside With your shirt tucked in and your shoes untied And you told me not to follow you
A Cup Of Coffee Would Of Been Nice.
322of365colors
Departure
Some deserted island somewhere
Strings of Color
Penelope
Loch Ness
Summer splash
Red compound eyes
The perfect trick.
Finished Spiderweb in watercolour quilt
life support
Lochside Trees - Loch Tulla
Peace & Love Cake
No title at all
paris
74/365 Tribute to samanthajane81
sorting and cleaning text file with link list c++ PDF Print E-mail

(link list ilen saçmalamaca) txt dosyamızdaki tüm veriler önce link listimize geçirilir ardından sıraya sokulur ardından aynı olanlar silinir sonra her iteratordeki abuk sabuk karakterler silinir sonra tekrar sırala tekrar sil yaz out.txt ye yeah
6 mb lık veriyi 6 sn de işlemektedir afferim ona diorum p4 3ghz ilen.

#include <string>
#include <iostream>
#include <fstream>
#include <algorithm>
#include <list>
#include <windows.h>

using namespace std;


int main()
{

long int before = GetTickCount();

list<string>::iterator it;
list<string> sL;
ifstream in("in.txt");
ofstream outL("out.txt");
string word;
char ignore[] = { '`''!''’''-''_''0''1''2''3''4',
'5''6''7''8''9''@''#''$''%''^''&''*''('')',
'~''"'',''.''=''/''<''>''['']''{''}'';'':',
'?''|''+''*'"'" };


while(in >> word){
transform(word.begin(), word.end(), word.begin()tolower);
sL.push_back(word);
}

sL.sort();
sL.unique();

for ( it = sL.begin() ; it != sL.end() ; it++ )
{
for (int i=0;< 43; i++)
it._Ptr->_Myval.erase( remove(it._Ptr->_Myval.begin(),it._Ptr->
_Myval.end(), ignore[i]) , it._Ptr->_Myval.end() );
}

sL.sort();
sL.unique();

for ( it = sL.begin() ; it != sL.end() ; it++ )
outL << *it << endl;

long int after = GetTickCount();
cout << "Elapsed Time "<< (after-before) << " ms\n";

system("PAUSE");
return 0;
}

Bookmark with:

Deli.cio.us    Digg    Facebook   
 

Your are currently browsing this site with Internet Explorer 6 (IE6).

Your current web browser must be updated to version 7 of Internet Explorer (IE7) to take advantage of all of template's capabilities.

Why should I upgrade to Internet Explorer 7? Microsoft has redesigned Internet Explorer from the ground up, with better security, new capabilities, and a whole new interface. Many changes resulted from the feedback of millions of users who tested prerelease versions of the new browser. The most compelling reason to upgrade is the improved security. The Internet of today is not the Internet of five years ago. There are dangers that simply didn't exist back in 2001, when Internet Explorer 6 was released to the world. Internet Explorer 7 makes surfing the web fundamentally safer by offering greater protection against viruses, spyware, and other online risks.

Get free downloads for Internet Explorer 7, including recommended updates as they become available. To download Internet Explorer 7 in the language of your choice, please visit the Internet Explorer 7 worldwide page.