/* copy_e_2_3_4_5_and_9.c */ /* Take a Control by the Number of Field. */ /* Modified Recyclable Object << 'firstwd()'. */ /* As I saw below, by using * isspace OR *from==' ', I can recognize field delimiter Blank (' '); * while by using * !isspace (NOT is space), I can capture the words at given field; */ /* Now, at any given field, I can skip or make it blank. * while () ++from; -> skip the field as if not exist. * while () *to++ = *from++ = ' ' -> make it erased (by white liquid paper). */ /* This was originally, Liquid Paper on 4th Field. Now, with * 'upField', 'downField' variables, Liquid Paper is moved into * 'main.c'. Therefore, at here, I just need to, * UpField control OR * DownField control * This one is for 'UpField' from 1st to 2nd. * Again here, I have Options for I do choose for mute-mode on 4th to end, * OR, do something else such 'break' to get out of While-loop. * Let me see. */ #include <ctype.h> extern char *copy_e_2_3_4_5_and_9 (char *to, char *from) { /* 1st: Capturing 1st Field(Word), This one makes Blanks. */ while ( isspace(*from) && *from!='\0' ) { *to++ = *from++ = ' '; } while ( !isspace(*from) && *from!='\0' ) { *to++ = *from++ = ' '; } /* Between Words, PRINT OUT AS "Blank(' ') Space" */ while ( isspace(*from) && *from!='\0' ) { *to++ = *from++ = ' '; } /* 2nd: Capturing 2nd Field(Word), COPY IT OUT. */ while ( !isspace(*from) && *from!='\0' ) { *to++ = *from++; } /* Between Words, PRINT OUT AS "Blank(' ') Space" */ while ( isspace(*from) && *from!='\0' ) { *to++ = *from++ = ' '; } /* 3rd: Capturing 2nd Field(Word), COPY IT OUT. */ while ( !isspace(*from) && *from!='\0' ) { *to++ = *from++; } /* Between Words, PRINT OUT AS "Blank(' ') Space" */ while ( isspace(*from) && *from!='\0' ) { *to++ = *from++ = ' '; } /* 4th: Capturing 2nd Field(Word), COPY IT OUT. */ while ( !isspace(*from) && *from!='\0' ) { *to++ = *from++; } /* Between Words, PRINT OUT AS "Blank(' ') Space" */ while ( isspace(*from) && *from!='\0' ) { *to++ = *from++ = ' '; } /* 5th: Capturing 2nd Field(Word), COPY IT OUT. */ while ( !isspace(*from) && *from!='\0' ) { *to++ = *from++; } /* Between Words, Read Blank(' ') or similar */ while ( isspace(*from) && *from!='\0' ) { *to++ = *from++ = ' '; } /* 6th: Capturing 6th Field(Word), Applying Blanks. */ while ( !isspace(*from) && *from!='\0' ) { *to++ = *from++ = ' '; } /* Between Words, Read Blank(' ') or similar */ while ( isspace(*from) && *from!='\0' ) { *to++ = *from++ = ' '; } /* 7th: Capturing 7th Field(Word), Applying Blanks. */ while ( !isspace(*from) && *from!='\0' ) { *to++ = *from++ = ' '; } /* Between Words, Read Blank(' ') or similar */ while ( isspace(*from) && *from!='\0' ) { *to++ = *from++ = ' '; } /* 8th: Capturing 8th Field(Word), Applying Blanks. */ while ( !isspace(*from) && *from!='\0' && *from!='.' ) { *to++ = *from++ = ' '; } /* 9th To-the-end: Until end of line, COPY IT OUT. */ while ( *from!='\0' ) { *to++ = *from++; } *to = '\0'; return (from); }