SSIS:需要处理SSIS中的Excel文件至一定范围,直到找到空白行

发布于 2025-02-05 18:33:00 字数 595 浏览 4 评论 0 原文

我有一个Excel文件.xlsx,我将从客户端获得,在某些行数据之后,它将有一个空白的行,然后每次都有一个通用的注释,该短语的起始作品始终相同,而不是整个短语。

我只想直到第5行(包括标头为列)执行SSIS,并且不想处理第6和7行,并且每次数据都会更改时,因此在这种情况下我什至无法进行范围。

我的灵活性要么在PREM SSIS或ADF上进行。

尝试使用过滤器,但由于单元格中的文本在4-5行中拆分时,它只忽略了第一行。

感谢任何帮助。

”在此处输入图像说明”

I have an excel file .xlsx which i will get from client and after certain rows data it will have a blank row and then a generic comment everytime and the starting work of that phrase will be same all the time and not the whole phrase.

I want to execute ssis only till row 5 including header as columns and not want to process line 6 and 7 and every time data changes so i can't even take a range in this case.

I have the flexibility do it either in on prem SSIS or ADF.

Tried using filters but as the text in the cell is splitted in 4-5 lines it only ignores the 1st line.

I would appreciate any help.

enter image description here

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

苏别ゝ 2025-02-12 18:33:00

使用 Azure Data Factory 数据流,您可以使用过滤器转换来根据条件忽略某些行。

示例:

excel输入:

”在此处输入图像说明”

adf数据流:

  1. 创建源 excel数据集。如果您的第一行不是标题,请不要启用第一行作为数据集中的标题属性。默认情况下,在阅读时将跳过空行。

  1. 添加 source 转换并将其连接到Excel数据集。如果数据中没有标题行,则将默认列名(例如 col0 )提供给您的数据。

  1. 添加过滤器源后转换,以滤除不需要的行。

    expression 不(例如({_ col0 _},'this%')))

“在此处输入图像说明”

使用 ssis ,在您的Excel源中,您可以使用SQL命令并编写查询来从Excel中提取数据。如果您有任何强制性列,请使用条件的过滤器,以便从文件中拉不为空行(例如:从[Sheet1 $]中选择 * [column1]不是null)。或使用条件拆分任务从Excel源过滤所需的行。

Using Azure data factory data flow, you can use filter transformation to ignore certain rows based on conditions.

Example:

Excel input:

enter image description here

ADF Data flow:

  1. Create a source excel dataset. If your first row is not a header do not enable the First row as header property in the dataset. Here by default, the empty rows will be skipped while reading.

enter image description here

  1. Add source transformation and connect it to the excel dataset. If you do not have a header row in the data, the default column names (like col0) were given to your data.

enter image description here

  1. Add filter transformation after source, to filter out the unwanted rows.

    Expression: not(like({_col0_},'This%'))

enter image description here

Filter output:

enter image description here

Using SSIS, in your Excel source, you can use the SQL command and write a query to pull the data from excel. If you have any mandatory columns, use filters with where condition to pull not null rows from the file (ex: SELECT * FROM [Sheet1$] WHERE [column1] IS NOT NULL). Or use the conditional split task to filter the required rows from the excel source.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文