Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 20th November 2011
Linuxmania Linuxmania is offline
Ceriwiser
 
Join Date: Nov 2011
Posts: 392
Rep Power: 15
Linuxmania mempunyai hidup yang Normal
Default [bonus GRP] cara baca file .csv dengan bahasa C

urgent nih all

saya ditugaskan untuk buat coding pake bahasa C buat baca file .csv



saya udh coba buat kaya gini




Quote:





#include

#include

#include

#include



void main()

{

char temp[150][150];

char waktu[150][150];

float price[150];

char signal[150][5];

int volume[150];

int akhir;

int i,j=0;

char *p;



FILE *in;



in=fopen("Backtest_prototype.csv","r");





while(!feof(in))

{



fgets(temp[i],strlen(temp[i])+1,in);



p=strtok(temp[i],",");

strcpy(waktu[i],p);



p=strtok(NULL,",");

price[i]=atof(p);



p=strtok(NULL,",");

strcpy(signal[i],p);



p=strtok(NULL,",");

volume[i]=atoi(p);



i++;

}

fclose(in);





for(j=0;jhttp://www.4*shared.com/file/u2je0L5x/Backtest_prototype.html

saya cuma mau masukkin 1 1 filenya ke array, nanti saya proses

trus ntar hasilnya dimasukkin ke file CSV itu juga



dan sesuai judul buat masing2 yang bantuin saya kasih 1 GRP gratis buat penghargaan saya atas usahanya

makasih all

</div>
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Terkait
Thread Thread Starter Forum Replies Last Post
JUAL Buku Cara Baca Kitab Bahasa Arab Lughatuna bookwithme Buku 0 18th July 2012 03:24 PM
Ask(cara baca file bahasa C) Guesuper Programming 0 20th November 2011 11:27 AM
Baca file dalam bahasa C Badguy13 Programming 0 20th November 2011 09:39 AM
[tanya] Bagaimana cara burn cd win7 dengan menambahkan isi dengan file yang lain Motherboard360 Hardware 0 18th November 2011 06:06 PM

 


All times are GMT +7. The time now is 11:16 AM.