Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- void read(FILE *f)
- {
- if (f)
- {
- char str[192];
- char aux_str1[96], aux_str2[64];
- int aux_nr1, aux_nr2;
- while (fgets(f, str, sizeof(str)))
- {
- if (fscanf(f, "%[^\n] REQPROD %d/%s;%d :", aux_str1, &aux_nr1, aux_str2, &aux_nr2) == 4)
- fprintf(stdout, "%d, %d\n", aux_nr1, aux_nr2);
- }
- }
- }
- int main(void)
- {
- FILE *f = fopen("test.txt", "r");
- if (!f)
- exit(-1);
- read(f);
- fclose(f);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement