Skip to content
Snippets Groups Projects
Commit 435dfe0b authored by Paul Best's avatar Paul Best
Browse files

minor rapport2txt

parent 625bbdfc
Branches
No related tags found
No related merge requests found
No preview for this file type
...@@ -40,13 +40,13 @@ typedef struct{ ...@@ -40,13 +40,13 @@ typedef struct{
}RAPPORT; }RAPPORT;
int main(int argc, char* argv[]){ int main(int argc, char* argv[]){
printf("Have you checked rorqual and cacha lensigs and config ?? (needs to match with pic32\'s)"); // printf("Have you checked rorqual and cacha lensigs and config ?? (needs to match with pic32\'s)");
FILE* infile = fopen(argv[1], "rb"); FILE* infile = fopen(argv[1], "rb");
if(infile==NULL){ if(infile==NULL){
printf("Failed to open input file\n"); printf("Failed to open input file\n");
return 0; return 0;
} }
strcpy(argv[1] + strlen(argv[1])-3, "txt\0"); strcpy(argv[1] + strlen(argv[1])-4, "txt\0");
FILE* outfile = fopen(argv[1], "w+"); FILE* outfile = fopen(argv[1], "w+");
if(outfile==NULL){ if(outfile==NULL){
printf("Failed to open output file\n"); printf("Failed to open output file\n");
...@@ -54,6 +54,7 @@ int main(int argc, char* argv[]){ ...@@ -54,6 +54,7 @@ int main(int argc, char* argv[]){
} }
RAPPORT rapport; RAPPORT rapport;
fread(&rapport, sizeof(RAPPORT), 1, infile); fread(&rapport, sizeof(RAPPORT), 1, infile);
printf("Writing into %s with %d fin whale pulses and %d sperm whale clicks \n", argv[1], rapport.numDetectionsRorqual, rapport.numDetectionsCachalot);
int i, j; int i, j;
fprintf(outfile, "Filename : %s \n", rapport.fileName); fprintf(outfile, "Filename : %s \n", rapport.fileName);
fprintf(outfile, "\n rorqual preds\n"); fprintf(outfile, "\n rorqual preds\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment