Jump to content

C++Da Dosyadan Veri Okutma


yow_sky
 Share

Recommended Posts

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 by yow_sky
Link to comment
Share on other sites

  • Editor
#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.

Link to comment
Share on other sites

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
}

Link to comment
Share on other sites

  • Editor

o zaman bendeki ile satırları okuyup. alparslanın yöntemlede regex kullanarak parçalayacakın o verileri. işin zor.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...