Line break is not recognized for header when importing CSV

huangapple go评论45阅读模式
英文:

Line break is not recognized for header when importing CSV

问题

I have a bunch of CSV files that I need to import via. SSIS. I think ( not 100% sure ) that the files origin from a unix like device.

我有一堆CSV文件需要通过SSIS导入。我认为(不确定100%)这些文件可能来自类似Unix的设备。

I have download the files via. C# from an FTP.

我已经通过C#从FTP下载了这些文件。

The files look like this when opened in Notepad++

在Notepad++中打开这些文件时,它们看起来像这样

The delimiters in the files is comma ,

文件中的分隔符是逗号,

The header use a new line char which is LF

标题使用换行符LF

But all data rows use CR LF as new line char.

但所有数据行使用CR LF作为换行符。

The encoding of the file is UTF-8 as show in Notepad++ below.

文件的编码是UTF-8,如下图在Notepad++中显示。

When I create the flat file connection manager in SSIS I choose UTF-8 as codepage and LF as header row delimiter.

当我在SSIS中创建平面文件连接管理器时,我选择UTF-8作为代码页,LF作为标题行分隔符。

But in the preview diaglog the header row delimiter is not recognized and the first datarow is used as column headers as well.

但在预览对话框中,标题行分隔符未被识别,并且第一行数据也被用作列标题。

I have not managed to understand what I am missing and is wondering if it is the codepage and the source of the files that is tricking me.

我还没有明白我漏掉了什么,我在想是否是代码页和文件的来源在欺骗我。

英文:

I have a bunch of CSV files that I need to import via. SSIS. I think ( not 100% sure ) that the files origin from a unix like device.

I have download the files via. C# from an FTP.

The files look like this when opened in Notepad++

Line break is not recognized for header when importing CSV

The delimiters in the files is comma ,

The header use a new line char which is LF

But all data rows use CR LF as new line char.

The encoding of the file is UTF-8 as show in Notepad++ below.

Line break is not recognized for header when importing CSV

When I create the flat file connection manager in SSIS I choose UTF-8 as codepage and LF as header row delimiter.

Line break is not recognized for header when importing CSV

But in the preview diaglog the header row delimiter is not recognized and the first datarow is used as column headers as well.

Line break is not recognized for header when importing CSV

I have not managed to understand what I am missing and is wondering if it is the codepage and the source of the files that is tricking me.

答案1

得分: 0

你可以通过将“要跳过的标题行数:”设置为1来轻松跳过标题行。

英文:

You can easily skip header row by setting the "Hearder rows to skip:" to 1.

huangapple
  • 本文由 发表于 2023年5月14日 06:29:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/76245122.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定