能不能去掉windows的回车符号,该如何解决

能不能去掉windows的回车符号
大师们好:
  我在用c写的文件用了一些字符串,保存到文本文件,想把这个文本文件转换到linux,因为linux只有换行'\n',而windows是\r\n,在文本文件不能看出,但是在UltraEdit软件能看出,如果在linux写的文件用这个软件打开只会有\n,它的十六进制为 0D。 怎么把windows的\r除去呢??????急救啊,谢谢大师们 拜上

------解决方案--------------------
如果在linux上去掉换行标志直接用tr -s '\r\n ' '\n' < 1.txt > 2.txt
------解决方案--------------------
FILE *f = fopen( "a.txt", "wb" );

可以吗
------解决方案--------------------
仅供参考:
命令行将'\r'行结束替换为'\n'行结束。
C/C++ code
#include <stdio.h>
FILE *f;
int c1,c2;
int main(int argc,char *argv[]) {
    if (argc!=2) {
        printf("Usage: Mac2Unix filename\n");
        return 1;
    }
    f=fopen(argv[1],"rb+");
    if (NULL==f) {
        printf("Can not open file [%s]!\n",argv[1]);
        return 2;
    }
    while (1) {
        c1=fgetc(f);
        if (EOF==c1) break;
        if ('\r'==c1) {
            c2=fgetc(f);
            if (EOF==c2) {
                fseek(f,-1L,SEEK_CUR);
                fputc('\n',f);
                break;
            }
            if ('\n'!=c2) {
                fseek(f,-2L,SEEK_CUR);
                fputc('\n',f);
                fseek(f,1,SEEK_CUR);
            }
        }
    }
    fclose(f);
    return 0;
}

------解决方案--------------------
注意一定要用二进制打开,否则Windows会自动加上/r的
------解决方案--------------------
不要把
fopen("...","...");fscanf,fprintf,fclose //读时把\r\n替换成\n,写时把\n替换成\r\n;读到\x1a就设置EOF;读写的内容当字符看待

fopen("...","...b");fread,fwrite,fclose //不作以上替换,遇到\x1a仍继续读;读写的内容当字节看待
弄混了

------解决方案--------------------
在UltraEdit里就能改。
Editplus,sakura之类的文本编辑器都行。
------解决方案--------------------
https://code.google.com/p/xcodelineending/
https://xcodelineending.googlecode.com/files/xCodeLineEnding.exe

这个工具可以批量的自动转换换行符。既支持win2unix,也支持unix2win。
只要选个目录,点下按钮,就会把所有文件都转换好。