我昨天用C已经写出来了,不过没你的好,你可以帮我参考下
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i=1;
char line[58];
FILE *fp1,*fp2;
if ((fp1=fopen("SWNT.arc","r"))==NULL)
{
printf("cannot open file\n");
exit(0);
}
if ((fp2=fopen("数据.xls","w"))==NULL)
{
printf("cannot open file\n");
exit(0);
}
while ((fgets(line,58,fp1))!=NULL)
{
if(line[0]=='C'&&line[1]=='2'&&line[2]==' '&&line[3]==' '&&line[56]=='1')
{
fputs(line,fp2);
fputs("\n",fp2);
printf("%s",line);
printf("\n",line);
}
}
fclose(fp1);
fclose(fp2);
return 0;
}