| ²é¿´: 597 | »Ø¸´: 2 | ||
| µ±Ç°Ö÷ÌâÒѾ´æµµ¡£ | ||
zzgybÈÙÓþ°æÖ÷ (ÎÄ̳¾«Ó¢)
|
[×ÊÔ´]
Windows¸ñʽµÄÎļþת³ÉUnix¸ñʽµÄÎļþ
|
|
|
Windows¸ñʽµÄÎļþת³ÉUnix¸ñʽµÄÎļþ /* win2unix */ #include "stdio.h" #include "stdlib.h" #include "conio.h" #include "string.h" int main(int argv, char * args[]){ FILE *fp1,*fp2; char c; char s[100]; if(argv<2){ printf("Usage: win2unix input-file-name [output-file-name]" ;return 1; } if((fp1=fopen(args[1],"rb" )==NULL){printf("Error: Fail to open %s.",args[1]); return 1; } if(argv==2){ sprintf(s,"u_%s",args[1]); } else{ sprintf(s,"%s",args[2]); if(strcmp(s,args[1])==0){ printf("Error: Output file name must not be same to that of the input file." ;fclose(fp1); return 1; } } fp2=fopen(s,"wb" ;while(1){ c=fgetc(fp1); if(feof(fp1)!=0){ break; } if(c!='\r'){ fputc(c,fp2); } } fclose(fp1); fclose(fp2); return 0; } ¸½£ºÈç¹ûÔÚUnixÏ£¬Ö»Ïû¼¸ÐÐÓï¾ä¾Í¿ÉÒÔ½â¾öÎÊÌ⣺ #!/bin/sh tr -d '\015' < "$1" >temp.$$ mv temp.$$ "$1" |
» ²ÂÄãϲ»¶
¹þ¶û±õÀí¹¤´óѧÎïÀíϵÕÐÊÕÎïÀíѧ¿¼Ñе÷¼Á
ÒѾÓÐ7È˻ظ´
0702Ò»Ö¾Ô¸¼ª´óBÇøÇóµ÷¼Á
ÒѾÓÐ5È˻ظ´
ÎïÀíѧIÂÛÎÄÈóÉ«/·ÒëÔõôÊÕ·Ñ?
ÒѾÓÐ74È˻ظ´
Çóµ÷¼Á
ÒѾÓÐ0È˻ظ´
0702Ò»Ö¾Ô¸¼ª´óBÇøÇóµ÷¼ÁÓÐÂÛÎÄ
ÒѾÓÐ0È˻ظ´
ÇëÎÊ»¹ÓÐûÓÐÓÃLatexдÎÄÕµÄС»ï°éÃÇ£¿
ÒѾÓÐ0È˻ظ´
¹âѧ¹¤³Ìѧ˶µ÷¼ÁÐÅÏ¢
ÒѾÓÐ31È˻ظ´
»¶Ó¼ÓÈë¿ÎÌâ×é
ÒѾÓÐ0È˻ظ´
É¢½ð±Ò£¬ÇóºÃÔË£¬×£ÃæÉÏ˳Àû£¡
ÒѾÓÐ68È˻ظ´
»ª¶«Ê¦·¶´óѧоƬÉè¼ÆÐìççÕæÊµË®Æ½Õ¦Ñù
ÒѾÓÐ1È˻ظ´
µ÷¼Á
ÒѾÓÐ0È˻ظ´
2Â¥2008-01-08 13:37:50
3Â¥2008-01-08 15:32:36













;
»Ø¸´´ËÂ¥