377376 附加到文件(Windows

编程入门 行业动态 更新时间:2024-10-09 12:33:34
本文介绍了377376 附加到文件(Windows -> Unix)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个执行以下操作的 SSIS 包.

I have an SSIS package that performs the following.

运行 SQL 脚本将结果导出到平面文件(UTF-8 编码、; 分隔和 用于换行)FTP 结果到solaris 机器(二进制格式) Run SQL script Export results to flat file (UTF-8 Encoded, ; delimitated, and for new lines) FTP results to solaris machine ( binary format )

问题是,当文件出现在我的solaris 机器上时,它在文件的开头有以下内容.

The problem is, that when the file is shows up on my solaris box it has the following at the start of the file.

377376

我已经尝试过 dos2unix,但仍然没有解决问题.事实上,它将377376 更改为227226,不是很有帮助.

I have tried dos2unix and still has not corrected the issue. In fact it changes the 377376 to 227226, not very helpful.

我的问题,有什么办法可以从我的文件中删除这些字符?当他们在那里时,他们会弄乱 grep 和其他 unix 工具,比如 head.

My question, any way to remove these characters from my file? When they are there they mess with grep and other unix tools like head.

推荐答案

默认情况下,任何 SSIS 或 windows 编码的文件都是 UCS-2-LITTLE-ENDIAN 编码的.最简单的方法是使用以下命令在您的 unix 服务器上对文件进行编码.

By default any SSIS or windows encoded file is UCS-2-LITTLE-ENDIAN encoded. The easiest way is to encode the file on your unix server with the following commands.

使用 iconv 切换到 UTF-8(或您需要的任何编码)

Switch over to UTF-8 (or whatever encoding you need) with iconv

iconv -f UCS-2-LITTLE-EDIAN -t UTF-8 输入 >输出

iconv -f UCS-2-LITTLE-EDIAN -t UTF-8 input > output

删除 ms 添加到留置权末尾的回车符.

Remove the carriage returns that ms adds to the end of liens.

unix2dos -ascii utf-8-file 输出文件

unix2dos -ascii utf-8-file outputfile

这篇关于377376 附加到文件(Windows -> Unix)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-03-29 13:18:20,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/757008.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   Windows

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!