yow_sky Posted May 8, 2014 Share Posted May 8, 2014 (edited) c++ İYİ BİLEN ARKADASLARA.. BİR STRİNG DİZİSİ İÇERSİNDE İSİM KAYITLI ATIYORUM mehmet_ali_alabora burada bulanan ''_'' göre isim soy isim olarak nasıl ayırırız tek isimli oldumu sıkıntı yok ama iki tane isim oldumu sıkıntı oluyor lütfen yardımcı olun bana Edited May 12, 2014 by yow_sky Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted May 8, 2014 Editor Share Posted May 8, 2014 #include "stdafx.h" #include <iostream> #include <fstream> #include <string> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { string satir; ifstream dosyam("C:\\yazi.txt"); if (dosyam.is_open()) { while (getline(dosyam, satir)) { cout << satir << '\n'; system("pause"); } dosyam.close(); system("pause"); } else cout << "Dosya Açılamadı."; return 0; } Bu şekilde satır satır okuyabilirsiniz. Ondan sonra satir değişkenindeki değere göre istediğinizi yapabilirsiniz. Quote Link to comment Share on other sites More sharing options...
alparslan Posted May 8, 2014 Share Posted May 8, 2014 I have a text file (~10GB) with the following format: data1<TAB>data2<TAB>data3<TAB>data4<NEWLINE> #include <stdio.h>...FILE* fp = fopen(path_to_file, "r");char[256] data;while(fscanf(fp, "%*s<tab>%s<tab>%*s<tab>%*s", data)){do what you want with your data} Quote Link to comment Share on other sites More sharing options...
yow_sky Posted May 8, 2014 Author Share Posted May 8, 2014 #include "stdafx.h" bende böyle bir kutuphane yok ne için dahil ettiğini yazarsan bişeyler bulmaya calısıcam Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted May 8, 2014 Editor Share Posted May 8, 2014 O satırı silebilirsin. Ben VS de yaptıgım için kendi ekledi. Dev C++ kullanacaksan gerke yok. Quote Link to comment Share on other sites More sharing options...
yow_sky Posted May 8, 2014 Author Share Posted May 8, 2014 visiual studio 2012 kullanıyorum kodlar biraz farklı .. ugrasıcam biraz ..eyvallah kank senin yaptığın mantıkla olmadı.. proje ekde var yardımcı olursan sevinirim yani lutfen :D http://yadi.sk/d/unfufDgqPXHUK Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted May 8, 2014 Editor Share Posted May 8, 2014 o zaman bendeki ile satırları okuyup. alparslanın yöntemlede regex kullanarak parçalayacakın o verileri. işin zor. Quote Link to comment Share on other sites More sharing options...
yow_sky Posted May 9, 2014 Author Share Posted May 9, 2014 Biraz zor oldu ama farklı bir mantık kullanarak hallettim işimi eyvallah. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.