您可以按SSIS中的管道划定行和列吗?

发布于 2025-02-01 08:06:58 字数 321 浏览 4 评论 0原文

从SSIS,我需要以格式发送Excel文件;

656265 | 56280212 ||
654581 | 56246894 ||
656111 | 56281475 ||

我目前有一个软件包,该软件包生成一个要显示为;的excel文件;

656265 | 56280212 
654581 | 56246894 
656111 | 56281475 

当我将列定界符设置为平面文件连接管理器上的垂直条(管道)时。

我将如何实现2个管道来划定行,因为SSI不允许您设置相同的行和列定界符?

From SSIS, I need to send an Excel file in the format of;

656265 | 56280212 ||
654581 | 56246894 ||
656111 | 56281475 ||

I currently have a package that generates an Excel file to be displayed as;

656265 | 56280212 
654581 | 56246894 
656111 | 56281475 

as I have set the column delimiter as a Vertical bar (pipe) on the flat file connection manager.

How would I achieve attaching the 2 pipes to delimit the rows as SSIS does not allow you to set the same row and column delimiter?

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

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

发布评论

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

评论(2

梦途 2025-02-08 08:06:58

您应该打开平面文件连接管理器,转到“高级”选项卡,然后按“新”按钮在文件末尾手动添加两个列:

单击新列来添加新列。默认情况下,新按钮在列表末尾添加了一个新列。

参考:

You should open the flat file connection manager, go to the "Advanced" Tab and add two columns manually at the end of the file by pressing the "New" button:

enter image description here

Add a new column by clicking New. By default, the New button adds a new column at the end of the list.

Reference:

浮世清欢 2025-02-08 08:06:58

使用“脚本任务”的解决方案之一
并读取文件数据,然后将其编辑为以下示例:

 using System;

public class HelloWorld
{
    public static void Main(string[] args)
    {
      //string str = File.ReadAllText("textFilePath");  
        string str =@"656265 | 56280212 
654581 | 56246894 
656111 | 56281475";


str= str.Replace(Environment.NewLine,"||" + Environment.NewLine) +" ||";

        Console.WriteLine (str);
    }
}

输出

656265 | 56280212 ||
654581 | 56246894 ||
656111 | 56281475 ||

One of the solutions by Using "Script Task"
and read the file data then edit it as below example:

 using System;

public class HelloWorld
{
    public static void Main(string[] args)
    {
      //string str = File.ReadAllText("textFilePath");  
        string str =@"656265 | 56280212 
654581 | 56246894 
656111 | 56281475";


str= str.Replace(Environment.NewLine,"||" + Environment.NewLine) +" ||";

        Console.WriteLine (str);
    }
}

Output

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