home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
mbug
/
mbug165.arc
/
EW2ASCII.C
< prev
next >
Wrap
Text File
|
1979-12-31
|
1KB
|
42 lines
/* Convert Early Word files to ASCII/WordStar files */
/* Hi-tech v1.4 version By Alan Laughton 8/6/91 */
#include <STDIO.H>
main() /* ew2ascii.c */
{
FILE *fi, *fo;
int c, count;
char source[25], dest[25];
puts("\n\nEarly Word files to ASCII files.\n");
printf("Input filename: ");
gets(source);
printf("Output filename: ");
gets(dest);
if((fi = fopen(source,"rb")) == NULL) {
printf("Can't open %s\n",source);
exit();
}
if((fo = fopen(dest,"wb")) == NULL) {
printf("Can't open %s\n",dest);
exit();
}
printf("\nWorking...\n\n");
count = 0;
while ((c = getc(fi)) != EOF) {
count++;
if (count % 512 == 0) /* put '*' */
printf("%c", '\052'); /* on screen */
c = c & 127; /* every 512 */
if ( c == '\r')
putc('\n',fo);
putc(c,fo);
}
printf("\n\nAll done.");
}