Created
May 14, 2013 12:56
-
-
Save yuikns/5575647 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void storeIntoCSV(hashmap *phmap) | |
{ | |
pNode np; | |
int plen; | |
int i; | |
int j; | |
unsigned long count; | |
pAlist ap = getAuthorList(); | |
FILE *fp; | |
if((fp = fopen("CoAuthor.csv","w")) == NULL) | |
{ | |
fprintf(stderr,"error opening CoAuthor.csv\n"); | |
} | |
count = hashmapCount(phmap); | |
printf(" count:%ld\n",count); | |
for(j=0;j<count && ap != NULL;j++) | |
{ | |
printf("%d:%ld ",j,ap->aid); | |
if((np=hashmapGet(phmap,(unsigned long)(ap->aid))) != NULL) | |
{ | |
printf("."); | |
plen = np->len; | |
for(i=0;i<plen-1;i++) | |
{ | |
fprintf(fp,"%ld,",np->aid[i]); | |
} | |
fprintf(fp,"%ld\n",np->aid[plen-1]); | |
} | |
printf("\n");fflush(NULL); | |
ap = ap->next; | |
} | |
fclose(fp); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nice!