I have this code
#include <stdio.h>
#include "ctype.h"
#include <string.h>
#include <stdlib.h>
#include <string.h>
char p;
int j;
int i;
FILE *f1;
char c;
int main()
{
f1 = fopen("ard.txt","r");
if(f1 == NULL)
{
printf("No se ha podido abrir el archivo");
}
while((c=fgetc(f1))!=EOF)
{
if (isdigit(c))
{
putchar(c);
}
else if (isspace(c))
{
putchar('\n');
else if(isalpha(c))
{
putchar(c);
}
else if (isspace(c))
{
putchar('\n');
}
}
}
And the txt file is it:
1234 234
34 j4
j5544 555 jose
and the output is it:
1234
234
34
j4
j5544
555
jose
the line between words should not leave
I need the output to be the next
1234 -------- number
234 --------- number
34 ------------- Number
j4 -------------- identifier
---------------------------- This line should not leave
j5544 -----------identifier
---------------------------------- This line should not leave
555 ------------ Number
jose ------------ word
how I do that and that does not leave the line between them applied and that appears
LABEL TO EACH FOR EACH LINE THAT IS NUMBER, WORD OR IDENTIFIER